Skip to content

Instantly share code, notes, and snippets.

@awjuliani
awjuliani / softmax.ipynb
Last active September 14, 2021 20:52
A simple ipython notebook that walks through the creation of a softmax regression model using MNIST dataset.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awjuliani
awjuliani / t-SNE Tutorial.ipynb
Created March 2, 2016 18:13
A notebook describing how to use t-SNE to visualize a neural network learn representations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
newpath = r'./csvs'
if not os.path.exists(newpath):
os.makedirs(newpath)
iters = 0
for i in finalRepresentations:
tsne = TSNE(perplexity=50, n_components=3, init='pca', n_iter=5000)
plot_only = 2000
lowDWeights = tsne.fit_transform(i[0:plot_only,:])
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awjuliani
awjuliani / cryptArithmetic.m
Created April 5, 2016 22:28
Matlab script to solve basic cryptarithmetic problems.
clear ; close all; clc
%Get input for three terms
prompt = 'First three letter term? ';
x1 = input(prompt, 's');
prompt = 'Second three letter term? ';
x2 = input(prompt, 's');
prompt = 'Four letter answer? ';
y = input(prompt, 's');
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awjuliani
awjuliani / pg-pong.py
Created June 5, 2016 02:12 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@awjuliani
awjuliani / rl-tutorial-1.ipynb
Last active February 2, 2020 05:04
Reinforcement Learning Tutorial 1 (Two-armed bandit problem)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awjuliani
awjuliani / rl-tutorial-2.ipynb
Last active May 2, 2018 18:55
Reinforcement Learning Tutorial 2 (Cart Pole problem)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awjuliani
awjuliani / rl-tutorial-3.ipynb
Last active March 24, 2021 07:38
Reinforcement Learning Tutorial in Tensorflow: Model-based RL
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.