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 datetime import datetime | |
| import numpy as np | |
| from keras import Input | |
| import keras.backend as K | |
| from keras.callbacks import TensorBoard | |
| from keras.engine import Model | |
| from keras.layers import LSTM, TimeDistributed, Dense, Reshape, Flatten, LeakyReLU, Lambda | |
| from keras.optimizers import Adam, sgd |
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 | |
| from torch.autograd import Variable | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| import torch.optim as optim | |
| import torchvision | |
| import torchvision.transforms as transforms |
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 roslib #; roslib.load_manifest('sr_example') | |
| import rospy | |
| from geometry_msgs.msg import Twist | |
| from std_msgs.msg import Float64, String | |
| rospy.init_node('turtlebot_controller', anonymous=True) | |
| def move(dist, angle): | |
| pub = rospy.Publisher('/turtle1/cmd_vel', Twist, queue_size=10) |
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 | |
| import torch.nn.functional as F | |
| import torchvision | |
| from torch.autograd import Variable | |
| from torchvision.transforms import CenterCrop, ToTensor, Compose, Lambda, Resize, Grayscale | |
| from torchvision.datasets import coco |
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, os, sys | |
| from torch import nn | |
| import torch.nn.functional as F | |
| import torch.distributions as ds | |
| from math import sqrt, ceil | |
| import layers, util |
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 | |
| from torch import nn | |
| import torch.distributions as dist | |
| ## REINFORCE | |
| adjacencies, num_edges, targets = load_data(...) | |
| opt = ... |
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
| # -- assignment 1 -- | |
| import numpy as np | |
| from urllib import request | |
| import gzip | |
| import pickle | |
| import os | |
| def load_synth(num_train=60_000, num_val=10_000, seed=0): | |
| """ | |
| Load some very basic synthetic data that should be easy to classify. Two features, so that we can plot the |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| package org.submassive; | |
| import java.io.BufferedInputStream; | |
| import java.io.BufferedReader; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileReader; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.InputStreamReader; |
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 wget, os, gzip, pickle, random, re, sys | |
| IMDB_URL = 'http://dlvu.github.io/data/imdb.{}.pkl.gz' | |
| IMDB_FILE = 'imdb.{}.pkl.gz' | |
| PAD, START, END, UNK = '.pad', '.start', '.end', '.unk' | |
| def load_imdb(final=False, val=5000, seed=0, voc=None, char=False): | |
| cst = 'char' if char else 'word' |