import argparse

def get_parser():
    def restricted_float(arg):
        if float(arg) < 0 or float(arg) > 1:
            raise argparse.ArgumentTypeError('{} not in range [0, 1]'.format(arg))

        return arg


    parser = argparse.ArgumentParser()

    model_arg = parser.add_argument_group('Model')
    model_arg.add_argument('--embedding_size', type=int, default=16,
                           help='Embedding size in generator and discriminator')
    model_arg.add_argument('--hidden_size', type=int, default=128,
                           help='Size of hidden state for lstm layers in generator')
    model_arg.add_argument('--num_layers', type=int, default=1,
                           help='Number of lstm layers in generator')
    model_arg.add_argument('--dropout', type=float, default=0,
                           help='Dropout probability for lstm layers in generator')
    model_arg.add_argument('--discriminator_layers', nargs='+', type=int, default=[32, 64, 128],
                           help='Numbers of features for convalution layers in discriminator')
    model_arg.add_argument('--reward_weight', type=restricted_float, default=0,
                           help='Reward weight for policy gradient training')


    train_arg = parser.add_argument_group('Training')
    train_arg.add_argument('--generator_pretrain-epochs', type=int, default=10,
                           help='Number of epochs for generator pretraining')
    train_arg.add_argument('--discriminator_pretrain_epochs', type=int, default=5,
                           help='Number of epochs for discriminator pretraining')
    train_arg.add_argument('--pg_iters', type=int, default=10000,
                           help='Number of inerations for policy gradient training')
    train_arg.add_argument('--n_batch', type=int, default=64,
                           help='Size of batch')
    train_arg.add_argument('--lr', type=float, default=1e-2,
                           help='Learning rate')
    train_arg.add_argument('--max_length', type=int, default=100,
                           help='Maximum length for sequence')
    train_arg.add_argument('--rollouts', type=int, default=4,
                           help='Number of rollouts')

    return parser


def get_config():
    parser = get_parser()
    return parser.parse_known_args()[0]
@@ -208,16 +208,312 @@
 rn arg%0A%0A
+    def conv_pair(arg):%0A        if arg%5B0%5D != '(' or arg%5B-1%5D != ')':%0A            raise argparse.ArgumentTypeError('Wrong pair: %7B%7D'.format(arg))%0A        %0A        feats, kernel_size = arg%5B1:-1%5D.split(',')%0A        feats, kernel_size = int(feats), int(kernel_size)%0A%0A        return feats, kernel_size%0A%0A
 %0A    par
@@ -665,10 +665,10 @@
 ult=
-16
+32
 ,%0A  
@@ -808,19 +808,19 @@
 default=
+5
 12
-8
 ,%0A      
@@ -1240,35 +1240,41 @@
 nargs='+', type=
-int
+conv_pair
 , default=%5B32, 6
@@ -1272,19 +1272,78 @@
 lt=%5B
-32, 64
+(128, 1), (128, 3), (128, 5), (128, 7)
 , 
+(
 128
+, 9), (128, 15), (128, 21)
 %5D,%0A 
@@ -1428,32 +1428,346 @@
 discriminator')%0A
+    model_arg.add_argument('--discriminator_dropout', type=float, default=0.75,%0A                           help='Dropout probability for discriminator')%0A    model_arg.add_argument('--discriminator_l2_reg', type=float, default=0.2,%0A                           help='L2 regularization coefficient for discriminator')%0A
     model_arg.ad
@@ -1820,32 +1820,34 @@
 float, default=0
+.5
 ,%0A              
@@ -2014,17 +2014,17 @@
 pretrain
--
+_
 epochs',
@@ -2042,18 +2042,18 @@
 default=
-10
+35
 ,%0A      
@@ -2204,17 +2204,18 @@
 default=
-5
+10
 ,%0A      
@@ -2353,17 +2353,16 @@
 ult=1000
-0
 ,%0A      
@@ -2609,17 +2609,17 @@
 ault=1e-
-2
+3
 ,%0A      
@@ -2849,17 +2849,17 @@
 default=
-4
+8
 ,%0A      
@@ -2905,16 +2905,327 @@
 llouts')
+%0A    train_arg.add_argument('--generator_updates', type=int, default=1,%0A                           help='Number of updates of generator per iteration')%0A    train_arg.add_argument('--discriminator_updates', type=int, default=30,%0A                           help='Number of updates of discriminator per iteration')
 %0A%0A    re
@@ -3321,8 +3321,9 @@
 rgs()%5B0%5D
+%0A

fix config for organ