Code for Keras plays catch blog post
python qlearn.py
python test.py
#!/usr/bin/env bash | |
# | |
# Fix virtualenv symlinks after upgrading python with Homebrew and then running | |
# `cleanup`. | |
# | |
# After upgrading Python using Homebrew and then running `brew cleanup` one can | |
# get this message while trying to run python: | |
# dyld: Library not loaded: @executable_path/../.Python | |
# Referenced from: /Users/pablo/.venv/my-app/bin/python | |
# Reason: image not found |
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
Code for Keras plays catch blog post
python qlearn.py
python test.py
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
package project2; | |
import java.io.*; | |
public class problem2 { | |
public static void main(String[] args) throws Exception { | |
int rnum[] = new int[11]; | |
int inum[] = new int[11]; | |
String ist[] = new String[11]; | |
double rd[] = new double[11]; | |
String slts; |
""" Poisson-loss Factorization Machines with Numba""" | |
# Author: Vlad Niculae <[email protected]> | |
# License: Simplified BSD | |
from __future__ import print_function | |
import numpy as np | |
from numba import jit | |
from scipy import sparse as sp | |
from sklearn.utils import check_random_state, check_array, check_X_y |
import numpy as np | |
from numpy.random import choice | |
def stirling(N, m): | |
if N < 0 or m < 0: | |
raise Exception("Bad input to stirling.") | |
if m == 0 and N > 0: | |
return 0 | |
elif (N, m) == (0, 0): | |
return 1 |
""" | |
This is a batched LSTM forward and backward pass | |
""" | |
import numpy as np | |
import code | |
class LSTM: | |
@staticmethod | |
def init(input_size, hidden_size, fancy_forget_bias_init = 3): |
# Authors: Kyle Kastner | |
# License: BSD 3-clause | |
import theano.tensor as T | |
import numpy as np | |
import theano | |
class rmsprop(object): | |
""" | |
RMSProp with nesterov momentum and gradient rescaling |