[main]
name="classification"
tf_manager=<tf_manager>
output="tests/outputs/classifier"
overwrite_output_dir=True
batch_size=16
epochs=4
train_dataset=<train_data>
val_dataset=<val_data>
trainer=<trainer>
runners=[<runner>,<logits_runner>]
postprocess=None
evaluation=[("classification", evaluators.Accuracy)]
logging_period=50
validation_period=100
random_seed=1234

[tf_manager]
class=tf_manager.TensorFlowManager
num_threads=4
num_sessions=1

[train_data]
class=dataset.load
series=["source", "classification", "source_chars"]
data=["tests/data/train.tc.en", "tests/data/train.words", (processors.helpers.preprocess_char_based, "source")]
buffer_size=32

[val_data]
class=dataset.load
series=["source", "classification", "source_chars"]
data=["tests/data/val.tc.en", "tests/data/val.words", (processors.helpers.preprocess_char_based, "source")]

[encoder_vocabulary]
class=vocabulary.from_wordlist
path="tests/data/encoder_vocab.tsv"

[encoder_rnn]
class=encoders.recurrent.SentenceEncoder
name="sentence_encoder"
rnn_size=7
max_input_len=4
embedding_size=11
dropout_keep_prob=0.5
data_id="source"
vocabulary=<encoder_vocabulary>

[encoder_attentive]
class=encoders.attentive.AttentiveEncoder
name="attentive_encoder"
input_sequence=<encoder_rnn>
hidden_size=9
num_heads=5
output_size=13

[encoder_pooling]
class=encoders.pooling.SequenceMaxPooling
name="maxpool_encoder"
input_sequence=<encoder_rnn>

[encoder_cnn]
class=encoders.sequence_cnn_encoder.SequenceCNNEncoder
name="sentence_cnn"
filters=[(2, 3), (3, 4)]
max_input_len=4
embedding_size=11
dropout_keep_prob=0.5
data_id="source"
vocabulary=<encoder_vocabulary>

[decoder_vocabulary]
class=vocabulary.from_wordlist
path="tests/data/classification.vocab"
contains_header=False
contains_frequencies=False

[decoder]
class=decoders.classifier.Classifier
name="decoder"
encoders=[<encoder_attentive>, <encoder_pooling>, <encoder_cnn>]
dropout_keep_prob=0.5
layers=[10,5]
data_id="classification"
activation_fn=tf.nn.relu
vocabulary=<decoder_vocabulary>

[encoder_pooling_adv]
class=model.gradient_reversal.StatefulView
reversed_object=<encoder_pooling>

[decoder_adv]
class=decoders.classifier.Classifier
encoders=[<encoder_pooling_adv>]
layers=[]
dropout_keep_prob=0.5
data_id="classification"
vocabulary=<decoder_vocabulary>

[trainer]
class=trainers.cross_entropy_trainer.CrossEntropyTrainer
decoders=[<decoder>, <decoder_adv>]
l2_weight=1.0e-8
clip_norm=1.0

[runner]
class=runners.GreedyRunner
decoder=<decoder>
output_series="classification"

[logits_runner]
class=runners.LogitsRunner
output_series="distribution"
decoder=<decoder>
