Beispiel #1
0
 assert(pred_curr<=0.4)
 
 
 #eps = [0.2, 0.12, 0.10, 0.08, 0.07, 0.06, 0.05, 0.01]
 eps = [0.08, 0.07, 0.06, 0.05, 0.03, 0.01]
 betas = data_pickle["betas"]
 reward_types = [True]
 
 res_r={}
 
 for reward_type in reward_types:
     res_b={}
     for beta in betas:
         thr=False
         res_e={}
         res_e[0]={"cnvg_val": trainer.test_curr_discriminator_batch(), "steps": 0}
         for epsilon in eps:
             print("t: "+str(n_authorized)+", snr: "+str(snr)+", eps: "+str(epsilon)+", beta: "+str(beta)+", reward: "+str(reward_type))
             if thr:
                 res_e[epsilon]={"cnvg_val": trainer.test_curr_discriminator_batch(), "steps": 0}
             else:
                 trainer.reset_generator(lr=1e-3, epsilon=epsilon, beta=beta, binary_reward=reward_type)
                 trainer.reflect_pre_train()
                 cnvg_val, steps = trainer.train_loop(steps=1000, sensitivity=sensitivity)
                 res_e[epsilon]={"cnvg_val": cnvg_val, "steps": steps}
                 if(cnvg_val < 0.01):
                     thr=True
             res_b[beta]=res_e
             res_r[reward_type]=res_b
             res_t[snr]=res_r
             data_pickle[n_authorized]=res_t
        assert (pred_curr <= 0.4)

        #eps = [0.2, 0.12, 0.10, 0.08, 0.07, 0.06, 0.05, 0.01]
        eps = [0.05]
        betas = [15000]
        reward_types = [False]

        res_r = {}

        for reward_type in reward_types:
            res_b = {}
            for beta in betas:
                thr = False
                res_e = {}
                res_e[0] = {
                    "cnvg_val": trainer.test_curr_discriminator_batch(),
                    "steps": 0
                }
                for epsilon in eps:
                    print("t: " + str(n_authorized) + ", snr: " + str(snr) +
                          ", eps: " + str(epsilon) + ", beta: " + str(beta) +
                          ", reward: " + str(reward_type))
                    if thr:
                        res_e[epsilon] = {
                            "cnvg_val":
                            trainer.test_curr_discriminator_batch(),
                            "steps": 0
                        }
                        continue
                    trainer.reset_generator(lr=1e-3,
                                            epsilon=epsilon,