-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
47 lines (36 loc) · 994 Bytes
/
config.py
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
import torch
class Config():
# ----cuda setting----#
use_cuda = torch.cuda.is_available()
CUDA_VISIBLE_DEVICES = [1]
device = torch.device('cuda:' + str(
CUDA_VISIBLE_DEVICES[0]) if use_cuda else 'cpu')
# --- data settting --- #
min_freq = 5
embedding_dim = 200
use_pretrain = True
freeze = True
max_sent_len = 100
max_num_sent = 100
min_num_sent = 1
n_label = 5
train_file = 'yelp-2014-train.txt.ss'
# train_file = 'yelp-2014-train.txt.ss'
valid_file = 'yelp-2014-dev.txt.ss'
test_file = 'yelp-2014-test.txt.ss'
sampler = 'NumSentence' # 'Random' 'NumSentence' 'MaxSentence'
reverse = True
# --- RNN setting --- #
word_hidden_dim = 50
sent_hidden_dim = 50
attn_dropout = 0
# --- training setting--- #
epoch = 100
batch_size = 256
optim = 'SGD' # 'Adam' or 'SGD'
lr = 2e-4
momentum = 0.9
clip = 0.5
interval = 3
experiment_id = 104
ops = Config