Skip to content

Instantly share code, notes, and snippets.

View Jeraldy's full-sized avatar
🎯
Focusing

Jeraldy Deus Jeraldy

🎯
Focusing
View GitHub Profile
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
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
@Jeraldy
Jeraldy / nn.java
Last active July 25, 2019 14:58
Implementing an Artificial Neural Network in Pure Java (No external dependencies)
/**
*
* @author Deus Jeraldy
* @Email: [email protected]
* BSD License
*/
// np.java -> https://gist.github.com/Jeraldy/7d4262db0536d27906b1e397662512bc
import java.util.Arrays;
package yourpackagename;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;