<jupyter_start><jupyter_text>MetNet Pytorch This repo implements my own approximation of [MetNet](https://arxiv.org/abs/2003.12140).![metnet](images/metnet_scheme.png)Take a look at the notebooks, you can install this repo using:```bashpip install -e .```<jupyter_code>from fastai.vision.all import *
from metnet_pytorch.model import DownSampler, MetNet<jupyter_output><empty_output><jupyter_text>Define the MetNet params:<jupyter_code>past_instants = 6
horizon = 10
xtra_features = 5
image_encoder = DownSampler(3 + xtra_features + horizon)
metnet = MetNet(image_encoder, hidden_dim=128, 
                ks=3, n_layers=1, horizon=horizon, 
                head=create_head(128, 1), n_feats=xtra_features, debug=True)
metnet.eval();
imgs = torch.rand(1,past_instants,3,64,64)
timeseries = torch.rand(1,xtra_features,past_instants)
with torch.no_grad():
    metnet(imgs, timeseries)<jupyter_output>Input -> (imgs: torch.Size([1, 6, 3, 64, 64]), feats: torch.Size([1, 5, 6]))
 augmented imgs:   torch.Size([1, 6, 8, 64, 64])
Encode Timestep:(i=0)
 input shape: torch.Size([1, 6, 8, 64, 64])
 CondTime->x.shape: torch.Size([1, 6, 18, 64, 64])
 encoded images shape: torch.Size([1, 6, 256, 16, 16])
 temp_enc out shape: torch.Size([1, 128, 16, 16])
Encode Timestep:(i=1)
 input shape: torch.Size([1, 6, 8, 64, 64])
 CondTime->x.shape: torch.Size([1, 6, 18, 64, 64])
 encoded images shape: torch.Size([1, 6, 256, 16, 16])
 temp_enc out shape: torch.Size([1, 128, 16, 16])
Encode Timestep:(i=2)
 input shape: torch.Size([1, 6, 8, 64, 64])
 CondTime->x.shape: torch.Size([1, 6, 18, 64, 64])
 encoded images shape: torch.Size([1, 6, 256, 16, 16])
 temp_enc out shape: torch.Size([1, 128, 16, 16])
Encode Timestep:(i=3)
 input shape: torch.Size([1, 6, 8, 64, 64])
 CondTime->x.shape: torch.Size([1, 6, 18, 64, 64])
 encoded images shape: torch.Size([1, 6, 256, 16, 16])
 temp_enc out shape: torch.Size([1,[...]
{'fraction_non_alphanumeric': 0.16929547844374343, 'fraction_numerical': 0.0904311251314406, 'mean_word_length': 5.079872204472843, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '506000', 'license': 'Apache-2.0', 'n_tokens_mistral': 876, 'n_tokens_neox': 720, 'n_words': 196, 'path': 'index.ipynb', 'repo_name': 'tcapelle/metnet_pytorch', 'size': '1902'}