Example #1
0
mlp_hidden_dims = [30]
lstm_hidden_dim = 20
noise_std = 0.1
dropout = 0.5

num_feats = 100
use_ensembling = False

randomize_feats = False

# step_rule = Momentum(learning_rate=0.01, momentum=0.9)
step_rule = AdaDelta()

# iter_scheme = LogregOrderTransposeIt(10, True, 'model_param/logreg_param.pkl', 500)
iter_scheme = RandomTransposeIt(None, True, num_feats, True)
valid_iter_scheme = RandomTransposeIt(None, True, None if use_ensembling else num_feats, True)

param_desc = '%s-%d-%s-%s-%s%s' % (repr(mlp_hidden_dims),
                              lstm_hidden_dim,
                              repr(noise_std),
                              repr(dropout),
                              'E' if use_ensembling else '',
                              'R' if randomize_feats else '')

pt_freq = 1

def construct_model(input_dim, out_dim):
    # Construct the model
    r = tensor.fmatrix('r')
    x = tensor.fmatrix('x')
Example #2
0
momentum = 0.9

if step_rule_name == 'adadelta':
    step_rule = AdaDelta()
elif step_rule_name == 'rmsprop':
    step_rule = RMSProp()
elif step_rule_name == 'momentum':
    step_rule_name = "mom%s,%s" % (repr(learning_rate), repr(momentum))
    step_rule = Momentum(learning_rate=learning_rate, momentum=momentum)
elif step_rule_name == 'adam':
    step_rule = Adam()
else:
    raise ValueError("No such step rule: " + step_rule_name)

ibatchsize = None
iter_scheme = RandomTransposeIt(ibatchsize, False, None, False)
valid_iter_scheme = RandomTransposeIt(ibatchsize, False, None, False)

w_noise_std = 0.05
r_dropout = 0.0
s_dropout = 0.0
i_dropout = 0.0
a_dropout = 0.0

center_feats = True
normalize_feats = True
randomize_feats = False

train_on_valid = False

reconstruction_penalty = 1
Example #3
0
from blocks.bricks import Rectifier, MLP, Softmax, Tanh
from blocks.initialization import IsotropicGaussian, Constant

from blocks.filter import VariableFilter
from blocks.roles import WEIGHT
from blocks.graph import ComputationGraph, apply_noise

from datastream import RandomTransposeIt

learning_rate = 0.00001
momentum = 0.9
# step_rule = Momentum(learning_rate=learning_rate, momentum=momentum)
step_rule = AdaDelta()

ibatchsize = 100
iter_scheme = RandomTransposeIt(ibatchsize, True, None, True)
valid_iter_scheme = iter_scheme

noise_std = 0.1

randomize_feats = False

hidden_dims = [2, 2]
activation_functions = [Tanh() for _ in hidden_dims] + [Tanh()]

param_desc = '%s-%s-%s-mom%s,%s-i%d' % (
    repr(hidden_dims), repr(noise_std), 'R' if randomize_feats else '',
    repr(learning_rate), repr(momentum), ibatchsize)

pt_freq = 11