forked from allenai/allennlp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbiattentive_classification_network.jsonnet
74 lines (74 loc) · 1.85 KB
/
biattentive_classification_network.jsonnet
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
{
"dataset_reader":{
"type": "sst_tokens",
"use_subtrees": true,
"granularity": "5-class"
},
"validation_dataset_reader":{
"type": "sst_tokens",
"use_subtrees": false,
"granularity": "5-class"
},
"train_data_path": "https://s3-us-west-2.amazonaws.com/allennlp/datasets/sst/train.txt",
"validation_data_path": "https://s3-us-west-2.amazonaws.com/allennlp/datasets/sst/dev.txt",
"test_data_path": "https://s3-us-west-2.amazonaws.com/allennlp/datasets/sst/test.txt",
"model": {
"type": "bcn",
"text_field_embedder": {
"token_embedders": {
"tokens": {
"pretrained_file": "https://s3-us-west-2.amazonaws.com/allennlp/datasets/glove/glove.840B.300d.txt.gz",
"type": "embedding",
"embedding_dim": 300,
"trainable": false
}
}
},
"embedding_dropout": 0.25,
"pre_encode_feedforward": {
"input_dim": 300,
"num_layers": 1,
"hidden_dims": [300],
"activations": ["relu"],
"dropout": [0.25]
},
"encoder": {
"type": "lstm",
"input_size": 300,
"hidden_size": 300,
"num_layers": 1,
"bidirectional": true
},
"integrator": {
"type": "lstm",
"input_size": 1800,
"hidden_size": 300,
"num_layers": 1,
"bidirectional": true
},
"integrator_dropout": 0.1,
"output_layer": {
"input_dim": 2400,
"num_layers": 3,
"output_dims": [1200, 600, 5],
"pool_sizes": 4,
"dropout": [0.2, 0.3, 0.0]
}
},
"iterator": {
"type": "bucket",
"sorting_keys": [["tokens", "num_tokens"]],
"batch_size" : 100
},
"trainer": {
"num_epochs": 40,
"patience": 5,
"grad_norm": 5.0,
"validation_metric": "+accuracy",
"cuda_device": 0,
"optimizer": {
"type": "adam",
"lr": 0.001
}
}
}