Example #1
0
data_path = '/home/junyoung/data/bouncing_balls/bouncing_ball_2balls_16wh_20len_50000cases.npy'
save_path = '/home/junyoung/repos/cle/saved/'

batch_size = 128
res = 256
debug = 0

model = Model()
trdata = BouncingBalls(name='train',
                       path=data_path)

init_W = InitCell('randn')
init_U = InitCell('ortho')
init_b = InitCell('zeros')

model.inputs = trdata.theano_vars()
x, y = model.inputs
if debug:
    x.tag.test_value = np.zeros((10, batch_size, res), dtype=np.float32)
    y.tag.test_value = np.zeros((10, batch_size, res), dtype=np.float32)

inputs = [x, y]
inputs_dim = {'x':256, 'y':256}

h1 = GFLSTM(name='h1',
            parent=['x'],
            recurrent=['h2', 'h3'],
            nout=200,
            unit='tanh',
            init_W=init_W,
            init_U=init_U,
Example #2
0
data_path = '/data/lisatmp3/chungjun/bouncing_balls/bouncing_ball_2balls_16wh_20len_50000cases.npy'
save_path = '/u/chungjun/repos/cle/saved/'

batch_size = 128
frame_size = 256
debug = 0

model = Model()
train_data = BouncingBalls(name='train',
                           path=data_path)

valid_data = BouncingBalls(name='valid',
                           path=data_path)

x, y = train_data.theano_vars()

if debug:
    x.tag.test_value = np.zeros((10, batch_size, frame_size), dtype=np.float32)
    y.tag.test_value = np.zeros((10, batch_size, frame_size), dtype=np.float32)

init_W = InitCell('randn')
init_U = InitCell('ortho')
init_b = InitCell('zeros')

h1 = GFLSTM(name='h1',
            parent=['x'],
            parent_dim=[frame_size],
            recurrent=['h2', 'h3'],
            recurrent_dim=[200, 200],
            nout=200,
Example #3
0
save_path = '/home/junyoung/src/cle/saved/'

batch_size = 128
frame_size = 256
debug = 0

model = Model()
train_data = BouncingBalls(name='train', path=data_path)

valid_data = BouncingBalls(name='valid', path=data_path)

init_W = InitCell('randn')
init_U = InitCell('ortho')
init_b = InitCell('zeros')

x, y = train_data.theano_vars()
if debug:
    x.tag.test_value = np.zeros((10, batch_size, frame_size), dtype=np.float32)
    y.tag.test_value = np.zeros((10, batch_size, frame_size), dtype=np.float32)

h1 = LSTM(name='h1',
          parent=['x'],
          parent_dim=[frame_size],
          nout=200,
          unit='tanh',
          init_W=init_W,
          init_U=init_U,
          init_b=init_b)

h2 = LSTM(name='h2',
          parent=['h1'],
Example #4
0
#save_path = '/u/chungjun/repos/cle/saved/'
data_path = '/home/junyoung/data/bouncing_balls/bouncing_ball_2balls_16wh_20len_50000cases.npy'
save_path = '/home/junyoung/repos/cle/saved/'

batch_size = 128
res = 256
debug = 0

model = Model()
trdata = BouncingBalls(name='train', path=data_path)

init_W = InitCell('randn')
init_U = InitCell('ortho')
init_b = InitCell('zeros')

model.inputs = trdata.theano_vars()
x, y = model.inputs
if debug:
    x.tag.test_value = np.zeros((10, batch_size, res), dtype=np.float32)
    y.tag.test_value = np.zeros((10, batch_size, res), dtype=np.float32)

inputs = [x, y]
inputs_dim = {'x': 256, 'y': 256}

h1 = GFLSTM(name='h1',
            parent=['x'],
            recurrent=['h2', 'h3'],
            nout=200,
            unit='tanh',
            init_W=init_W,
            init_U=init_U,
Example #5
0
#data_path = '$your_data_path'
data_path = '/data/lisatmp3/chungjun/bouncing_balls/bouncing_ball_2balls_16wh_20len_50000cases.npy'
#save_path = '$your_model_path'
save_path = '/u/chungjun/src/cle/saved/'
#pkl_name = '$your_model_name'
pkl_name = 'toy_bb_lstm.pkl'

frame_size = 256
# How many examples you want to proceed at a time
batch_size = 100
debug = 0

test_data = BouncingBalls(name='test',
                          path=data_path)

x = test_data.theano_vars()
if debug:
    x.tag.test_value = np.zeros((15, batch_size, frame_size), dtype=np.float32)

exp = unpickle(save_path + pkl_name)
nodes = exp.model.nodes
names = [node.name for node in nodes]

[h1, h2, h3, h4] = nodes

s1_0 = h1.get_init_state(batch_size)
s2_0 = h2.get_init_state(batch_size)
s3_0 = h3.get_init_state(batch_size)

x = T.fmatrix()
ts = T.iscalar()
Example #6
0
#data_path = '$your_data_path'
data_path = '/data/lisatmp3/chungjun/bouncing_balls/bouncing_ball_2balls_16wh_20len_50000cases.npy'
#save_path = '$your_model_path'
save_path = '/u/chungjun/src/cle/saved/'
#pkl_name = '$your_model_name'
pkl_name = 'toy_bb_lstm.pkl'

frame_size = 256
# How many examples you want to proceed at a time
batch_size = 100
debug = 0

test_data = BouncingBalls(name='test', path=data_path)

x = test_data.theano_vars()
if debug:
    x.tag.test_value = np.zeros((15, batch_size, frame_size), dtype=np.float32)

exp = unpickle(save_path + pkl_name)
nodes = exp.model.nodes
names = [node.name for node in nodes]

[h1, h2, h3, h4] = nodes

s1_0 = h1.get_init_state(batch_size)
s2_0 = h2.get_init_state(batch_size)
s3_0 = h3.get_init_state(batch_size)

x = T.fmatrix()
ts = T.iscalar()
Example #7
0
batch_size = 128
res = 256
debug = 0

model = Model()
train_data = BouncingBalls(name='train',
                           path=data_path)

# Choose the random initialization method
init_W = InitCell('randn')
init_U = InitCell('ortho')
init_b = InitCell('zeros')

# Define nodes: objects
model.inputs = train_data.theano_vars()
x, y = model.inputs
# You must use THEANO_FLAGS="compute_test_value=raise" python -m ipdb
if debug:
    x.tag.test_value = np.zeros((10, batch_size, res), dtype=np.float32)
    y.tag.test_value = np.zeros((10, batch_size, res), dtype=np.float32)

inputs = [x, y]
inputs_dim = {'x':256, 'y':256}

# Using skip connections is easy
h1 = SimpleRecurrent(name='h1',
                     parent=['x'],
                     nout=200,
                     unit='tanh',
                     init_W=init_W,
Example #8
0
save_path = '/home/junyoung/repos/cle/saved/'

batch_size = 128
res = 256
debug = 0

model = Model()
train_data = BouncingBalls(name='train', path=data_path)

# Choose the random initialization method
init_W = InitCell('randn')
init_U = InitCell('ortho')
init_b = InitCell('zeros')

# Define nodes: objects
model.inputs = train_data.theano_vars()
x, y = model.inputs
# You must use THEANO_FLAGS="compute_test_value=raise" python -m ipdb
if debug:
    x.tag.test_value = np.zeros((10, batch_size, res), dtype=np.float32)
    y.tag.test_value = np.zeros((10, batch_size, res), dtype=np.float32)

inputs = [x, y]
inputs_dim = {'x': 256, 'y': 256}

# Using skip connections is easy
h1 = SimpleRecurrent(name='h1',
                     parent=['x'],
                     nout=200,
                     unit='tanh',
                     init_W=init_W,