Skip to content

Instantly share code, notes, and snippets.

Avatar

Lorenzo Stella lostella

View GitHub Profile
@lostella
lostella / loader_sanity_check.py
Created Sep 7, 2020
GluonTS data loader sanity check
View loader_sanity_check.py
import time
import mxnet as mx
from gluonts.dataset.repository.datasets import get_dataset
from gluonts.dataset.loader import TrainDataLoader
from gluonts.model.deepar import DeepAREstimator
from gluonts.mx.batchify import batchify as mx_batchify
dataset = get_dataset("electricity")
@lostella
lostella / loader_example.py
Created Sep 7, 2020
GluonTS data loading example
View loader_example.py
import time
from functools import partial
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import mxnet as mx
import torch
View file_indexing.py
from pathlib import Path
from typing import List
class IndexedFile:
def __init__(self, path: Path) -> None:
self.path = path
self.offset: List[int] = []
self._build_index()
View 2018-10-11-serialization-issue.py
import mxnet as mx
class MyBlock(mx.gluon.HybridBlock):
def __init__(self):
super().__init__()
with self.name_scope():
self.lstmcell = mx.gluon.rnn.LSTMCell(hidden_size=20)
def hybrid_forward(self, F, seq):
outputs, state = self.lstmcell.unroll(inputs=seq, length=10, layout="NTC", merge_outputs=True)
View 2018-10-10-serialization-issue.py
import mxnet as mx
class MyBlock(mx.gluon.HybridBlock):
def __init__(self):
super().__init__()
with self.name_scope():
self.lstm = mx.gluon.rnn.HybridSequentialRNNCell()
for layer in range(3):
self.lstm.add(mx.gluon.rnn.LSTMCell(hidden_size=20))
View keybase.md

Keybase proof

I hereby claim:

  • I am lostella on github.
  • I am lostella (https://keybase.io/lostella) on keybase.
  • I have a public key ASAiQnm-kLkopRgiLCGDKC5w5ZcA-ehLSCEZAp-HYjaxLAo

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am lostella on github.
  • I am lostella (https://keybase.io/lostella) on keybase.
  • I have a public key whose fingerprint is FBAB AFA4 81E5 F7BA E3D7 9DD3 ACE0 41D6 6164 F46C

To claim this, I am signing this object: