<commit_before>from anna.model.trainer import Trainer
from anna.model.encode import *
from anna.model.decode import *


class AVGxBR(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderAvg(data_dir, input_limit=300),
                         DecoderBR(data_dir, len(labels), [1024, 1024]),
                         name="avg_br",
                         *args, **kwargs)

    def __repr__(self):
        return "AVGxBR - Average input, independent binary predictions."


class MAXxBR(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderMax(data_dir, input_limit=300),
                         DecoderBR(data_dir, len(labels), [1024, 1024]),
                         name="max_br",
                         *args, **kwargs)

    def __repr__(self):
        return "MAXxBR - Max pooling for the input, " + \
               "independent binary predictions."


class CNNxBR(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderCNN(data_dir),
                         DecoderBR(data_dir, len(labels), [1024, 1024]),
                         name="cnn_br",
                         batch_size=16,
                         *args, **kwargs)

    def __repr__(self):
        return "CNNxBR - Convolutional network to analyze input, " + \
               "independent binary predictions."


class AVGxRNN(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderAvg(data_dir, input_limit=300),
                         DecoderRNN(data_dir, labels, beam_width=12),
                         name="avg_rnn",
                         grad_clip=5.0,
                         *args, **kwargs)

    def __repr__(self):
        return "AVGxRNN - Average input, sequence prediction with a GRU."


class RNNxBR(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderBiRNN(data_dir, input_limit=300),
                         DecoderBR(data_dir, len(labels), [1024, 1024]),
                         name="rnn_br",
                         grad_clip=5.0,
                         *args, **kwargs)

    def __repr__(self):
        return "RNNxBR - Recurrent network to analyze input, " + \
               "independent binary predictions."


class RNNxRNN(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderBiRNN(data_dir, input_limit=300),
                         DecoderRNN(data_dir, labels, beam_width=12),
                         name="rnn_rnn",
                         learning_rate=0.0002,
                         grad_clip=5.0,
                         *args, **kwargs)

    def __repr__(self):
        return "RNNxRNN - Recurrent network to analyze input, " + \
               "sequence prediction with a GRU."


class EncDec(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderBiRNN(data_dir, input_limit=300),
                         DecoderRNN(data_dir, labels,
                                    attention=tf.contrib.seq2seq.LuongAttention,
                                    beam_width=12),
                         name="enc_dec",
                         learning_rate=0.0002,
                         grad_clip=5.0,
                         *args, **kwargs)

    def __repr__(self):
        return "EncDec - Recurrent network to analyze input, " + \
               "sequence prediction with RNN and attention (GRU & Luong)."<commit_msg>premade: use more aggressive dropout for seq2seq<commit_after>from anna.model.trainer import Trainer
from anna.model.encode import *
from anna.model.decode import *


class AVGxBR(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderAvg(data_dir, input_limit=300),
                         DecoderBR(data_dir, len(labels), [1024, 1024]),
                         name="avg_br",
                         *args, **kwargs)

    def __repr__(self):
        return "AVGxBR - Average input, independent binary predictions."


class MAXxBR(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderMax(data_dir, input_limit=300),
                         DecoderBR(data_dir, len(labels), [1024, 1024]),
                         name="max_br",
                         *args, **kwargs)

    def __repr__(self):
        return "MAXxBR - Max pooling for the input, " + \
               "independent binary predictions."


class CNNxBR(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderCNN(data_dir),
                         DecoderBR(data_dir, len(labels), [1024, 1024]),
                         name="cnn_br",
                         batch_size=16,
                         *args, **kwargs)

    def __repr__(self):
        return "CNNxBR - Convolutional network to analyze input, " + \
               "independent binary predictions."


class AVGxRNN(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderAvg(data_dir, input_limit=300),
                         DecoderRNN(data_dir, labels, beam_width=12),
                         name="avg_rnn",
                         grad_clip=5.0,
                         *args, **kwargs)

    def __repr__(self):
        return "AVGxRNN - Average input, sequence prediction with a GRU."


class RNNxBR(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderBiRNN(data_dir, input_limit=300),
                         DecoderBR(data_dir, len(labels), [1024, 1024]),
                         name="rnn_br",
                         grad_clip=5.0,
                         *args, **kwargs)

    def __repr__(self):
        return "RNNxBR - Recurrent network to analyze input, " + \
               "independent binary predictions."


class RNNxRNN(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderBiRNN(data_dir, input_limit=300),
                         DecoderRNN(data_dir, labels, beam_width=12),
                         name="rnn_rnn",
                         learning_rate=0.0002,
                         grad_clip=5.0,
                         *args, **kwargs)

    def __repr__(self):
        return "RNNxRNN - Recurrent network to analyze input, " + \
               "sequence prediction with a GRU."


class EncDec(Trainer):
    def __init__(self, data_dir, labels, *args, **kwargs):
        super().__init__(data_dir,
                         labels,
                         EncoderBiRNN(data_dir,
                                      dropout=0.5,
                                      input_limit=300),
                         DecoderRNN(data_dir, labels,
                                    dropout=0.5,
                                    attention=tf.contrib.seq2seq.LuongAttention,
                                    beam_width=12),
                         name="enc_dec",
                         learning_rate=0.0002,
                         grad_clip=5.0,
                         *args, **kwargs)

    def __repr__(self):
        return "EncDec - Recurrent network to analyze input, " + \
               "sequence prediction with RNN and attention (GRU & Luong)."
{'fraction_non_alphanumeric': 0.09812462189957653, 'fraction_numerical': 0.019237749546279492, 'mean_word_length': 1.3664471800744347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3670380', 'n_tokens_mistral': 2379, 'n_tokens_neox': 2136, 'n_words': 475}