View jupyter_logging.py
"""
In jupyter notebook simple logging to console
"""
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
# Test
logger = logging.getLogger('LOGGER_NAME')
View AdamStepLR.py
class AdamStepLR(torch.optim.Adam):
"""Combine Adam and lr_scheduler.StepLR so we can use it as a normal optimiser"""
def __init__(self, params, lr=0.001, betas=(0.9, 0.999), eps=1e-08, weight_decay=0, step_size=50000, gamma=0.5):
super().__init__(params, lr, betas, eps, weight_decay)
self.scheduler = torch.optim.lr_scheduler.StepLR(self, step_size, gamma)
def step(self):
self.scheduler.step()
return super().step()
View pytorch_window_stack.py
def window_stack(x, window=4, pad=True):
"""
Stack along a moving window of a pytorch timeseries
Inputs:
tensor of dims (batches/time, channels)
pad: if true the left side will be padded to let the output match
Outputs:
if pad=True: a tensor of size (batches, channels, window)
else: tensor of size (batches-window, channels, window)
View layer_norm_conv2d.py
import torch
import torch.nn as nn
class LayerNormConv2d(nn.Module):
"""
Layer norm the just works on the channel axis for a Conv2d
Ref:
- code modified from https://github.com/Scitator/Run-Skeleton-Run/blob/master/common/modules/LayerNorm.py
- paper: https://arxiv.org/abs/1607.06450
View batchrenorm2d.py
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.autograd as autograd
from torch.nn.parameter import Parameter
from torch.autograd import Variable
def r_d_max_func(itr):
"Default max r and d provider as recommended in paper."
View hydrosaver.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View pandas_profiling_hydrosaver.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Profile report</title>
<meta name="description" content="Profile report generated by pandas-profiling. See GitHub.">
<meta name="author" content="pandas-profiling">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
View NoisyConv2d.py
"""
A noisy convolution 2d for pytorch
Adapted from:
- https://raw.githubusercontent.com/Scitator/Run-Skeleton-Run/master/common/modules/NoisyLinear.py
- https://github.com/pytorch/pytorch/pull/2103/files#diff-531f4c06f42260d699f43dabdf741b6d
More details can be found in the paper `Noisy Networks for Exploration`
Original: https://gist.github.com/wassname/001aff274c7c8196055fabfc06cf80c5
"""
import math
View check_normalization.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View checking_random_transform.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.