[
{
    "message": "model & config for JUND, 15 tasks, pretraining, ver 18_07_31",
    "other_data_loaders":{
        "train": {
            "class": "pyfasta_data_loader.SingleStreamSeqOnly",
            "kwargs": {
               "batch_size": 200,
               "bed_source": "splits/train.tsv.gz",
               "fasta_data_source": "/srv/scratch/ktian/kundajelab/ENCODE/genome/hg19.fa",
               "rc_augment": true,
               "num_to_load_for_eval": 50000,
               "labels_dtype": "int"
            }
        }
    },
    "model_creator":{
        "class": "flexible_keras.FlexibleKerasSequential",
        "kwargs": {
            #"pretrained_model_config": {
            #    "kwargs": {
            #        "weight_file": "pretrain/model_files/record_1_Weights.h5",
            #        "json_file":   "pretrain/model_files/record_1_Json.json",
            #        "last_layer_to_take": -2
            #    }
            #}
            "layers_config": [
                {
                    # --- conv layer 1
                    "class": "keras.layers.convolutional.Convolution1D",
                    "kwargs": {
                        "input_shape": [1000,4],
                        "nb_filter": 50,
                        "filter_length": 15,
                        "border_mode": "same",
                        "W_constraint": {
                            "autoload": true, #turn the dictionary into a class
                            "class": "keras.constraints.maxnorm",
                            "kwargs": {"max_value": 7, "axis": 1}
                        }
                    }
                },
                { "class": "keras.layers.normalization.BatchNormalization", "kwargs": {"axis": -1} }, 
                { "class": "keras.layers.core.Activation", "kwargs": {"activation": "relu"} },
                    # --- conv layer 2
                { "class": "keras.layers.convolutional.Convolution1D",
                    "kwargs": { "nb_filter": 50, "filter_length": 15, "border_mode": "same" }
                },
                { "class": "keras.layers.normalization.BatchNormalization", "kwargs": {"axis": -1} },
                { "class": "keras.layers.core.Activation", "kwargs": {"activation": "relu"} },
                    # --- conv layer 3
                { "class": "keras.layers.convolutional.Convolution1D",
                    "kwargs": { "nb_filter": 50, "filter_length": 13, "border_mode": "same" }
                },
                { "class": "keras.layers.normalization.BatchNormalization", "kwargs": {"axis": -1} },
                { "class": "keras.layers.core.Activation", "kwargs": {"activation": "relu"} },
                { "class": "keras.layers.convolutional.MaxPooling1D",
                    "kwargs": {"pool_length": 40, "stride": 40}
                },
                { "class": "keras.layers.core.Flatten", "kwargs": {} },
                    # --- FC dense layer 1
                { "class": "keras.layers.core.Dense", "kwargs": {"output_dim": 50} },
                { "class": "keras.layers.normalization.BatchNormalization", "kwargs": {"axis": -1} },
                { "class": "keras.layers.core.Activation", "kwargs": {"activation": "relu"} },
                { "class": "keras.layers.core.Dropout", "kwargs": {"p": 0.2} },
                    # --- FC dense layer 2
                { "class": "keras.layers.core.Dense", "kwargs": {"output_dim": 15} },
                { "class": "keras.layers.core.Activation", "kwargs": {"activation": "sigmoid"} }
            ],
            "optimizer_config": {
                "class": "keras.optimizers.Adam",
                "kwargs": {"lr": 0.001}
            },
            "loss": {
                "modules_to_load": ["keras_genomics"],
                "func": "keras_genomics.losses.ambig_binary_crossentropy"
            }
        }
    },
    "model_trainer":{
        "class": "keras_model_trainer.KerasFitGeneratorModelTrainer",
        "kwargs": {
            "seed": 1234,
            "samples_per_epoch": 60,
            "stopping_criterion_config": {
                "class": "EarlyStopping" ,
                "kwargs": {
                   "max_epochs": 1000,
                   "epochs_to_wait": 20
                }
            },
            #"class_weight": {"0":1, "1":10}
        }
    },
}
]

