Created
May 20, 2020 08:52
-
-
Save himkt/f01d3158a1db41f5f5afa776d0a8069b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local batch_size = 64; | |
local cuda_device = 0; | |
local num_epochs = 15; | |
local seed = 42; | |
local embedding_dim = 128; | |
local dropout = 0.2; | |
local lr = 0.1; | |
local max_filter_size = 4; | |
local num_filters = 128; | |
local output_dim = 128; | |
local ngram_filter_sizes = std.range(2, max_filter_size); | |
{ | |
numpy_seed: seed, | |
pytorch_seed: seed, | |
random_seed: seed, | |
dataset_reader: { | |
lazy: false, | |
type: 'text_classification_json', | |
tokenizer: { | |
type: 'spacy', | |
}, | |
token_indexers: { | |
tokens: { | |
type: 'single_id', | |
lowercase_tokens: true, | |
}, | |
}, | |
}, | |
datasets_for_vocab_creation: ['train'], | |
train_data_path: 'https://s3-us-west-2.amazonaws.com/allennlp/datasets/imdb/train.jsonl', | |
validation_data_path: 'https://s3-us-west-2.amazonaws.com/allennlp/datasets/imdb/dev.jsonl', | |
model: { | |
type: 'basic_classifier', | |
text_field_embedder: { | |
token_embedders: { | |
tokens: { | |
embedding_dim: embedding_dim, | |
}, | |
}, | |
}, | |
seq2vec_encoder: { | |
type: 'cnn', | |
embedding_dim: embedding_dim, | |
ngram_filter_sizes: ngram_filter_sizes, | |
num_filters: num_filters, | |
output_dim: output_dim, | |
}, | |
dropout: dropout, | |
}, | |
data_loader: { | |
shuffle: true, | |
batch_size: batch_size, | |
}, | |
trainer: { | |
cuda_device: cuda_device, | |
num_epochs: num_epochs, | |
optimizer: { | |
lr: lr, | |
type: 'sgd', | |
}, | |
validation_metric: '+accuracy', | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment