Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from torch import nn | |
| from torch.nn import init | |
| from torch.nn import functional as F | |
| def init_conv(conv, glu=True): | |
| init.kaiming_normal(conv.weight) | |
| if conv.bias is not None: | |
| conv.bias.data.zero_() | |
| class ConvBlock(nn.Module): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import torch.nn as nn | |
| from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence | |
| seqs = ['gigantic_string','tiny_str','medium_str'] | |
| # make <pad> idx 0 | |
| vocab = ['<pad>'] + sorted(set(''.join(seqs))) | |
| # make model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #reference https://unix.stackexchange.com/questions/136371/how-to-download-a-folder-from-google-drive-using-terminal | |
| #get cookie and code | |
| wget --save-cookies cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/Code: \1\n/p' | |
| #download the file | |
| wget --load-cookies cookies.txt 'https://docs.google.com/uc?export=download&confirm=CODE_FROM_ABOVE&id=FILEID' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Weight norm is now added to pytorch as a pre-hook, so use that instead :) | |
| import torch | |
| import torch.nn as nn | |
| from torch.nn import Parameter | |
| from functools import wraps | |
| class WeightNorm(nn.Module): | |
| append_g = '_g' | |
| append_v = '_v' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
As configured in my dotfiles.
start new:
tmux
start new with session name: