isoexp/mab/main_mab.py [68:91]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}
results = []
full_algo = algorithms

for alg_name in full_algo.keys():

    alg = full_algo[alg_name]

    regret = np.zeros((nb_simu, T))
    rwds = 0*regret
    times = 0*regret
    attacks = 0*regret

    for k in tqdm(range(nb_simu), desc='Simulating {}'.format(alg_name)):
        try:
            rewards, draws = alg(T, MAB)
        except ValueError:
            rewards, draws, att, times_of_att = alg(T, MAB)
            attacks[k] = np.cumsum(att)
            times[k] = times_of_att
        rwds[k] = np.cumsum(means[draws.astype('int')])
        regret[k] = max(means) * np.arange(1, T + 1) - rwds[k]

    results += [(alg_name, MABResults(regret=regret, cum_rewards=rwds, attacks=attacks, times_of_attacks=times))]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



isoexp/main_mab.py [76:99]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}
results = []
full_algo = algorithms

for alg_name in full_algo.keys():

    alg = full_algo[alg_name]

    regret = np.zeros((nb_simu, T))
    rwds = 0*regret
    times = 0*regret
    attacks = 0*regret

    for k in tqdm(range(nb_simu), desc='Simulating {}'.format(alg_name)):
        try:
            rewards, draws = alg(T, MAB)
        except ValueError:
            rewards, draws, att, times_of_att = alg(T, MAB)
            attacks[k] = np.cumsum(att)
            times[k] = times_of_att
        rwds[k] = np.cumsum(means[draws.astype('int')])
        regret[k] = max(means) * np.arange(1, T + 1) - rwds[k]

    results += [(alg_name, MABResults(regret=regret, cum_rewards=rwds, attacks=attacks, times_of_attacks=times))]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



