-
Notifications
You must be signed in to change notification settings - Fork 2
/
train.yaml
81 lines (81 loc) · 2.73 KB
/
train.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
!obj:pylearn2.train.Train {
dataset: &train !obj:dataset.KBCDataset {
which_set: 'train',
home_dir: &data_dir 'dataset',
max_labels: &max_labels 40,
},
model: !obj:pylearn2.models.mlp.MLP {
layers: [
!obj:pylearn2.sandbox.nlp.models.mlp.ProjectionLayer {
layer_name: 'projection',
dim: 10,
irange: 0.3
},
!obj:pylearn2.models.mlp.RectifiedLinear {
layer_name: 'h',
dim: 10,
irange: 0.3,
},
!obj:pylearn2.models.mlp.Softmax {
layer_name: 'y',
n_classes: 2,
irange: 0.05,
binary_target_dim: 1,
},
],
input_space: !obj:pylearn2.space.IndexSpace {
dim: 3,
max_labels: *max_labels,
}
},
algorithm: !obj:pylearn2.training_algorithms.sgd.SGD {
train_iteration_mode: 'random_uniform',
batches_per_iter: 50,
batch_size: 100,
# without monitoring_batch_size here, pylearn2 will copy both
# monitoring_batch_size and monitoring_batches from their training
# counterparts which create an error
monitoring_batch_size: 100,
learning_rate: 1.0,
# ensure reproducibility
seed: 20141202,
monitoring_dataset: {
'train' : *train,
'valid' : !obj:dataset.KBCDataset {
which_set: 'valid',
home_dir: *data_dir,
max_labels: *max_labels,
},
'test' : !obj:dataset.KBCDataset {
which_set: 'test',
home_dir: *data_dir,
max_labels: *max_labels,
},
},
termination_criterion: !obj:pylearn2.termination_criteria.MonitorBased {
channel_name: 'valid_objective',
prop_decrease: 0.001,
N: 50,
},
learning_rule: !obj:pylearn2.training_algorithms.learning_rule.Momentum {
init_momentum: .5
},
cost: !obj:pylearn2.costs.cost.SumOfCosts {
costs: [
!obj:pylearn2.costs.mlp.Default {},
!obj:pylearn2.costs.mlp.WeightDecay {
coeffs: [ .00001, .00001, .00001, ]
}
]
},
},
extensions: [
!obj:pylearn2.train_extensions.best_params.MonitorBasedSaveBest {
# Use negative log likelihood instead of misclassification rate
# because: (i) it is more sensitive and (ii) we care about
# entity vectors but not classification
channel_name: 'valid_y_nll',
save_path: 'model.pkl',
},
],
}