-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.py
39 lines (28 loc) · 1.69 KB
/
model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from cloudcasting.models import AbstractModel
import ocf_tsimagemixer
# We define a new class that inherits from AbstractModel
class TSImageMixer(AbstractModel):
"""TSImageMixer model class"""
def __init__(self, history_steps: int, example_parameter: int) -> None:
# All models must include `history_steps` as a parameter. This is the number of previous
# frames that the model uses to makes its predictions. This should not be more than 25, i.e.
# 6 hours (inclusive of end points) of 15 minutely data.
# The history_steps parameter should be specified in `validate_config.yml`, along with
# any other parameters (replace `example_parameter` with as many other parameters as you need to initialize your model, and also add them to `validate_config.yml` under `model: params`)
super().__init__(history_steps)
###### YOUR CODE HERE ######
# Here you can add any other parameters that you need to initialize your model
# You might load your trained ML model or set up an optical flow method here.
# You can also access any code from src/ocf_tsimagemixer, e.g.
x = ocf_tsimagemixer.load_model()
############################
def forward(self, X):
# This is where you will make predictions with your model
# The input X is a numpy array with shape (batch_size, channels, time, height, width)
###### YOUR CODE HERE ######
...
def hyperparameters_dict(self):
# This function should return a dictionary of hyperparameters for the model
# This is just for your own reference and will be saved with the model scores to wandb
###### YOUR CODE HERE ######
...