Last active
July 22, 2020 08:17
-
-
Save himkt/047b90d7dbead38e4c6a58703df2d40a 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 = std.parseInt(std.extVar('embedding_dim')); | |
| local dropout = std.parseJson(std.extVar('dropout')); | |
| local lr = std.parseJson(std.extVar('lr')); | |
| local max_filter_size = std.parseInt(std.extVar('max_filter_size')); | |
| local num_filters = std.parseInt(std.extVar('num_filters')); | |
| local output_dim = std.parseInt(std.extVar('output_dim')); | |
| 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