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:
# Just journal for today: journal | |
# yesterday: journal -1 | |
# in a directory: (cd PATH && journal) | |
function journal { | |
case "$(uname -s)" in | |
Linux*) machine=linux;; | |
Darwin*) machine=mac;; | |
esac | |
if [[ $machine == "mac" ]] then |
# Works on gluonts dev branch as of May 30th, 2023 | |
# Assumes "m5-forecasting-accuracy" folder with data next to the script | |
# Data is obtained from https://www.kaggle.com/c/m5-forecasting-accuracy | |
import pandas as pd | |
from pathlib import Path | |
from gluonts.dataset.pandas import PandasDataset | |
# Load data from csv files |
syntax on | |
filetype plugin indent on | |
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smarttab autoindent | |
set incsearch ignorecase smartcase hlsearch | |
set wildmode=longest,list,full wildmenu | |
set ruler laststatus=2 showcmd showmode | |
set list listchars=trail:»,tab:»- | |
set fillchars+=vert:\ | |
set wrap breakindent | |
set encoding=utf-8 |
from gluonts.dataset.repository.datasets import get_dataset, dataset_names | |
def check_train_test_split(dataset): | |
prediction_length = dataset.metadata.prediction_length | |
train_end = {} | |
for entry in dataset.train: | |
assert entry["item_id"] not in train_end, f"item {k} is duplicate" | |
train_end[entry["item_id"]] = entry["start"] + len(entry["target"]) * entry["start"].freq |
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") |
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 |
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() | |
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) |
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)) |
I hereby claim:
To claim this, I am signing this object: