Skip to content

Instantly share code, notes, and snippets.

@jgc128
jgc128 / main.py
Created August 13, 2017 15:43
PyTroch DataParallel Example
import numpy as np
import torch
import torch.nn
import torch.cuda
from torch.autograd import Variable
class Net(torch.nn.Module):
def __init__(self):
def tokenize_story_line(story_line):
tokens = re.findall(r'(\w+)', story_line)
return tokens
def load_stories(file):
data = []
with file.open() as f:
story = []
#!/bin/bash
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python3.6 python3.6-dev python3.6-venv
python3.6 -m venv venv_smekh
. venv_smekh/bin/activate
pip install azure mrjob warcio
python3.6 -m venv /tmp/venv_smekh
. /tmp/venv_smekh/bin/activate
pip install azure mrjob warcio