Skip to content

Instantly share code, notes, and snippets.

View rogaha's full-sized avatar

Roberto Gandolfo Hashioka rogaha

  • Docker, Inc
  • San Francisco, CA
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
@n0ts
n0ts / get_oracle_jdk_x64.sh
Last active September 16, 2023 12:07
Get latest Oracle JDK package bash shell script for linux/osx/windows
#!/bin/bash
# You must accept the Oracle JDK License Update
# https://www.oracle.com/java/technologies/javase-downloads.html
# usage: get_oracle_jdk_x64.sh <jdk_version> <platform> <ext>
# jdk_version: 14
# platform: linux or osx or windows
# ext: rpm or dmg or tar.gz or exec
jdk_version=${1:-14}
@syhw
syhw / dnn.py
Last active January 24, 2024 19:38
A simple deep neural network with or w/o dropout in one file.
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
@sofoklis
sofoklis / LogiclaExpressionParser.scala
Last active December 9, 2020 12:40
Parser Combinators - A logical expression parser
package org.papasofokli
import scala.util.parsing.combinator.JavaTokenParsers
/**
* <b-expression>::= <b-term> [<orop> <b-term>]*
* <b-term> ::= <not-factor> [AND <not-factor>]*
* <not-factor> ::= [NOT] <b-factor>
* <b-factor> ::= <b-literal> | <b-variable> | (<b-expression>)
*/