This file contains 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 tensorflow as tf | |
from memory_profiler import profile | |
import argparse | |
@profile | |
def test(device, case, soft_placement): | |
print(device, case, soft_placement) | |
config = tf.ConfigProto() |
This file contains 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 numpy as np | |
import theano | |
import theano.tensor as T | |
import lasagne | |
from collections import OrderedDict | |
def get_adam_steps_and_updates(all_grads, params, learning_rate=0.001, | |
beta1=0.9, beta2=0.999, epsilon=1e-8): | |
t_prev = theano.shared(lasagne.utils.floatX(0.)) |
This file contains 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 numpy as np | |
from keras.models import Sequential | |
from keras.layers import GRU, Activation | |
INP_DIM = 10 | |
OUT_DIM = 3 | |
BATCH_SIZE = 1 | |
SEQ_LEN = 5 | |
model1 = Sequential() |
This file contains 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.layers import Merge, InputLayer, Dense, Input, merge, Permute, Layer, Lambda | |
from keras.models import Sequential, Model | |
from keras import backend as K | |
import numpy as np | |
FEATURE_SIZE = 10 | |
FEATURE_BATCH = 10 | |
INDICES_SIZE = FEATURE_BATCH | |
INDICES_BATCH = 5 | |
HIDDEN_SIZE = 20 |
This file contains 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.layers import Merge, InputLayer, Dense, Input, merge | |
from keras.models import Sequential, Model | |
from keras import backend as K | |
import numpy as np | |
FEATURE_SIZE = 10 | |
FEATURE_BATCH = 10 | |
INDICES_SIZE = FEATURE_BATCH | |
INDICES_BATCH = 5 |