Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
# list of supported hooks: https://pre-commit.com/hooks.html
- id: trailing-whitespace
Expand All @@ -12,20 +12,20 @@ repos:
- id: detect-private-key

# python code formatting/linting
- repo: https://github.com/charliermarsh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.0.263"
rev: "v0.6.8"
hooks:
- id: ruff
args: [--fix]
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.8.0
hooks:
- id: black
args: [--line-length, "100"]
# yaml formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types: [yaml]
1 change: 1 addition & 0 deletions pseudo_labeller/model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Models"""

from pseudo_labeller.model.idam import PsuedoIrradienceForecastor
13 changes: 5 additions & 8 deletions pseudo_labeller/model/idam.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Psuedo-irradience forecastor/labeller"""

import einops
import torch
import torch.nn as nn
Expand Down Expand Up @@ -68,7 +69,7 @@ def __init__(
in_channels=input_channels,
out_channels=conv3d_channels,
kernel_size=(kernel_size, kernel_size, kernel_size),
padding=(1,0,0),
padding=(1, 0, 0),
)
)
for i in range(0, num_layers):
Expand All @@ -77,7 +78,7 @@ def __init__(
in_channels=conv3d_channels,
out_channels=conv3d_channels,
kernel_size=(kernel_size, kernel_size, kernel_size),
padding=(1,0,0),
padding=(1, 0, 0),
)
)

Expand All @@ -95,9 +96,7 @@ def __init__(
# Small head model to convert from latent space to PV generation for training
# Input is per-pixel input data, this will be
# reshaped to the same output steps as the latent head
self.pv_meta_input = nn.Linear(
pv_meta_input_channels, out_features=hidden_dim
)
self.pv_meta_input = nn.Linear(pv_meta_input_channels, out_features=hidden_dim)

# Output is forecast steps channels, each channel is a timestep
# For labelling, this should be 1, forecasting the middle
Expand Down Expand Up @@ -142,7 +141,5 @@ def forward(self, x: torch.Tensor, pv_meta: torch.Tensor = None, output_latents:
x = torch.cat([x, pv_meta], dim=1)
# Get pv_meta_output
x = self.pv_meta_output(x)
x = F.relu(
self.pv_meta_output2(x)
) # Generation can only be positive or 0, so ReLU
x = F.relu(self.pv_meta_output2(x)) # Generation can only be positive or 0, so ReLU
return x
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Usual setup file for package """

# read the contents of your README file
from pathlib import Path

Expand Down
Loading