import tensorflow as tf

# flags = tf.app.flags
#
#
# ############################
# #    hyper parameters      #
# ############################
#
# # For separate margin loss
# flags.DEFINE_float('m_plus', 0.9, 'the parameter of m plus')
# flags.DEFINE_float('m_minus', 0.1, 'the parameter of m minus')
# flags.DEFINE_float('lambda_val', 0.5, 'down weight of the loss for absent digit classes')
#
# # for training
# flags.DEFINE_integer('batch_size', 128, 'batch size')
# flags.DEFINE_integer('epoch', 50, 'epoch')
# flags.DEFINE_integer('iter_routing', 3, 'number of iterations in routing algorithm')
# flags.DEFINE_boolean('mask_with_y', True, 'use the true label to mask out target capsule or not')
#
# flags.DEFINE_float('stddev', 0.01, 'stddev for W initializer')
# flags.DEFINE_float('regularization_scale', 0.392, 'regularization coefficient for reconstruction loss, default to 0.0005*784=0.392')
#
#
# ############################
# #   environment setting    #
# ############################
# flags.DEFINE_string('dataset', 'mnist', 'The name of dataset [mnist, fashion-mnist')
# flags.DEFINE_boolean('is_training', True, 'train or predict_data phase')
# flags.DEFINE_integer('num_threads', 8, 'number of threads of enqueueing exampls')
# flags.DEFINE_string('logdir', 'logdir', 'logs directory')
# flags.DEFINE_integer('train_sum_freq', 100, 'the frequency of saving train summary(step)')
# flags.DEFINE_integer('val_sum_freq', 500, 'the frequency of saving valuation summary(step)')
# flags.DEFINE_integer('save_freq', 3, 'the frequency of saving model(epoch)')
# flags.DEFINE_string('results', 'out', 'path for saving results')
#
# ############################
# #   distributed setting    #
# ############################
# flags.DEFINE_integer('num_gpu', 2, 'number of gpus for distributed training')
# flags.DEFINE_integer('batch_size_per_gpu', 128, 'batch size on 1 gpu')
# flags.DEFINE_integer('thread_per_gpu', 4, 'Number of preprocessing threads per tower.')

# cfg = tf.app.flags.FLAGS
# tf.logging.set_verbosity(tf.logging.INFO)

cfg = tf.contrib.training.HParams(
    #cfg
            out_dir='./out/dbnCaps',
            input_size=182,
out_size=2,
batch_size=148,
    # dbn net
            nn_hsizes=[128, 16],
            nn_layer_size=2,
            nn_activate=tf.nn.relu,
    #dbn train param

            dbn_momentum=0.96,
            dbn_learning_rate=0.02,
            dbn_epoches=1000,
    # caps net
primaryCaps_out_num = 10,
            primaryCaps_vec_num = 8,
            outCaps_vec_num = 16,
            mask_with_y = True,
            # caps train param
            caps_startLr=0.04,
            caps_decay_steps=1500,
            caps_decay_rate=0.96,
            caps_epochs=50000,
    #caps train show
            print_frq=1000,
            val_frq=100,
# decoder net
decoder_sizes=[128],
decoder_size= 1,
    # loss param
m_plus=0.9,
m_minus=0.1,
lambda_val=0.5,
regularization_scale=0.392,
stddev=0.01,
iter_routing=3
)


