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
from keras.optimizers import Optimizer | |
from keras.legacy import interfaces | |
from keras import backend as K | |
import tensorflow as tf | |
class Adabound(Optimizer): | |
def __init__(self, lr=0.001, | |
beta_1=0.9, beta_2=0.999, | |
gamma=0.001, |
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 os | |
import subprocess | |
import random | |
import numpy as np | |
import torch | |
import torch.nn as nn | |
import torch.optim as optimizers | |
from torch.autograd import Variable |
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
const seedrandom = require('seedrandom'); | |
const print = require('./utils').print; | |
const math = require('./math'); | |
const LSTM = require('./lstm'); | |
let rng = seedrandom(1234); | |
function main() { | |
const TRAIN_NUM = 30; // time sequence | |
const TEST_NUM = 10; |
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
const math = require('./math'); | |
class LSTM { | |
constructor(nIn, nHidden, nOut, learningRate, activation = math.fn.tanh, rng = Math.random) { | |
this.nIn = nIn; | |
this.nHidden = nHidden; | |
this.nOut = nOut; | |
this.learningRate = learningRate; | |
this.activation = activation; |
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
const print = require('./utils').print; | |
const math = require('./math'); | |
const seedrandom = require('seedrandom'); | |
const RNN = require('./rnn'); | |
let rng = seedrandom(1234); | |
function main() { |
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
const math = require('./math'); | |
class RNN { | |
constructor(nIn, nHidden, nOut, truncatedTime = 3, learningRate = 0.1, activation = math.fn.tanh, rng = Math.random) { | |
this.nIn = nIn; | |
this.nHidden = nHidden; | |
this.nOut = nOut; | |
this.truncatedTime = truncatedTime; | |
this.learningRate = learningRate; | |
this.activation = activation; |
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
package DeepLearning; | |
import java.util.Random; | |
import java.util.List; | |
import java.util.ArrayList; | |
public class Dropout { | |
public int N; | |
public int n_in; | |
public int[] hidden_layer_sizes; |
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
package DeepLearning; | |
public class LogisticRegression { | |
public int N; | |
public int n_in; | |
public int n_out; | |
public double[][] W; | |
public double[] b; | |
public LogisticRegression(int N, int n_in, int n_out) { |
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
package DeepLearning; | |
import java.util.Random; | |
public class utils { | |
public static double uniform(double min, double max, Random rng) { | |
return rng.nextDouble() * (max - min) + min; | |
} | |
public static int binomial(int n, double p, Random rng) { |
NewerOlder