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
# Based on https://scipy-lectures.org/packages/scikit-learn/auto_examples/plot_tsne.html | |
# tSNE: https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding | |
# MNIST Dataset: http://yann.lecun.com/exdb/mnist/ | |
import struct | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt |
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 time, os, sys, argparse | |
import numpy as np # linear algebra | |
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) | |
np.random.seed(94103) | |
import torch | |
import torch.nn as nn | |
from torch.optim import Adam | |
from torch.utils.data import DataLoader |
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 time | |
import numpy as np | |
import torch | |
from lighter.train import AsynchronousLoader | |
from torch.utils.data import DataLoader | |
batch_size = 2 ** 13 | |
length = 100 | |
device = torch.device('cuda:0') |
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 numpy as np | |
import gym | |
def sigmoid(x): | |
return 1.0 / (1.0 + np.exp(-x)) | |
env = gym.make('CartPole-v1') | |
desired_state = np.array([0, 0, 0, 0]) | |
desired_mask = np.array([0, 0, 1, 0]) |