Coder Social home page Coder Social logo

zhufx666 / metnet_pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tcapelle/metnet_pytorch

0.0 0.0 0.0 273 KB

A MetNet implementation in Pytorch and fastai

Home Page: https://tcapelle.github.io/metnet_pytorch/

License: Apache License 2.0

Python 27.60% Makefile 0.89% Jupyter Notebook 71.51%

metnet_pytorch's Introduction

MetNet Pytorch

This repo implements my own approximation of MetNet.

metnet Take a look at the notebooks, you can install this repo using:

pip install -e .
from fastai.vision.all import *
from metnet_pytorch.model import DownSampler, MetNet

Define the MetNet params:

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)
 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, 128, 16, 16])
Encode Timestep:(i=4)
 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=5)
 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=6)
 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=7)
 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=8)
 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=9)
 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])
res.shape=torch.Size([10])

metnet_pytorch's People

Contributors

tcapelle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.