implementation of (a variant of) epsilon greedy bandit algorithm
Definition in file bandit_epsgreedy.c.
#include "scip/bandit.h"
#include "scip/bandit_epsgreedy.h"
#include "scip/pub_bandit.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/scip_bandit.h"
#include "scip/scip_mem.h"
#include "scip/scip_randnumgen.h"
Go to the source code of this file.
Macros | |
#define | BANDIT_NAME "eps-greedy" |
#define | EPSGREEDY_SMALL 1e-6 |
Functions | |
SCIP_DECL_BANDITFREE (SCIPbanditFreeEpsgreedy) | |
SCIP_DECL_BANDITSELECT (SCIPbanditSelectEpsgreedy) | |
SCIP_DECL_BANDITUPDATE (SCIPbanditUpdateEpsgreedy) | |
SCIP_DECL_BANDITRESET (SCIPbanditResetEpsgreedy) | |
SCIP_RETCODE | SCIPbanditCreateEpsgreedy (BMS_BLKMEM *blkmem, BMS_BUFMEM *bufmem, SCIP_BANDITVTABLE *vtable, SCIP_BANDIT **epsgreedy, SCIP_Real *priorities, SCIP_Real eps, SCIP_Bool usemodification, SCIP_Bool preferrecent, SCIP_Real decayfactor, int avglim, int nactions, unsigned int initseed) |
SCIP_RETCODE | SCIPcreateBanditEpsgreedy (SCIP *scip, SCIP_BANDIT **epsgreedy, SCIP_Real *priorities, SCIP_Real eps, SCIP_Bool usemodification, SCIP_Bool preferrecent, SCIP_Real decayfactor, int avglim, int nactions, unsigned int initseed) |
SCIP_Real * | SCIPgetWeightsEpsgreedy (SCIP_BANDIT *epsgreedy) |
void | SCIPsetEpsilonEpsgreedy (SCIP_BANDIT *epsgreedy, SCIP_Real eps) |
SCIP_RETCODE | SCIPincludeBanditvtableEpsgreedy (SCIP *scip) |
#define BANDIT_NAME "eps-greedy" |
Definition at line 42 of file bandit_epsgreedy.c.
Referenced by SCIPcreateBanditEpsgreedy(), SCIPcreateBanditExp3(), SCIPcreateBanditExp3IX(), SCIPcreateBanditUcb(), SCIPincludeBanditvtableEpsgreedy(), SCIPincludeBanditvtableExp3(), SCIPincludeBanditvtableExp3IX(), and SCIPincludeBanditvtableUcb().
#define EPSGREEDY_SMALL 1e-6 |
Definition at line 43 of file bandit_epsgreedy.c.
Referenced by SCIP_DECL_BANDITRESET(), and SCIP_DECL_BANDITSELECT().
SCIP_DECL_BANDITFREE | ( | SCIPbanditFreeEpsgreedy | ) |
callback to free bandit specific data structures
Definition at line 70 of file bandit_epsgreedy.c.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArray, NULL, SCIP_OKAY, SCIPbanditGetData(), SCIPbanditGetNActions(), and SCIPbanditSetData().
SCIP_DECL_BANDITSELECT | ( | SCIPbanditSelectEpsgreedy | ) |
selection callback for bandit algorithm
Definition at line 93 of file bandit_epsgreedy.c.
References assert(), EPSGREEDY_SMALL, NULL, SCIP_OKAY, SCIP_Real, SCIPbanditGetData(), SCIPbanditGetNActions(), SCIPbanditGetRandnumgen(), SCIPrandomGetInt(), SCIPrandomGetReal(), and selection.
SCIP_DECL_BANDITUPDATE | ( | SCIPbanditUpdateEpsgreedy | ) |
update callback for bandit algorithm
Definition at line 187 of file bandit_epsgreedy.c.
References assert(), NULL, SCIP_OKAY, SCIP_Real, SCIPbanditGetData(), and selection.
SCIP_DECL_BANDITRESET | ( | SCIPbanditResetEpsgreedy | ) |
reset callback for bandit algorithm
Definition at line 223 of file bandit_epsgreedy.c.
References assert(), BMSclearMemoryArray, EPSGREEDY_SMALL, NULL, SCIP_OKAY, SCIP_Real, SCIPbanditGetData(), SCIPbanditGetNActions(), SCIPbanditGetRandnumgen(), SCIPrandomGetReal(), and w.
SCIP_RETCODE SCIPbanditCreateEpsgreedy | ( | BMS_BLKMEM * | blkmem, |
BMS_BUFMEM * | bufmem, | ||
SCIP_BANDITVTABLE * | vtable, | ||
SCIP_BANDIT ** | epsgreedy, | ||
SCIP_Real * | priorities, | ||
SCIP_Real | eps, | ||
SCIP_Bool | usemodification, | ||
SCIP_Bool | preferrecent, | ||
SCIP_Real | decayfactor, | ||
int | avglim, | ||
int | nactions, | ||
unsigned int | initseed ) |
internal method to create and reset epsilon greedy bandit algorithm
blkmem | block memory |
bufmem | buffer memory |
vtable | virtual function table with epsilon greedy callbacks |
epsgreedy | pointer to store the epsilon greedy bandit algorithm |
priorities | nonnegative priorities for each action, or NULL if not needed |
eps | parameter to increase probability for exploration between all actions |
usemodification | TRUE if modified eps greedy should be used |
preferrecent | should the weights be updated in an exponentially decaying way? |
decayfactor | the factor to reduce the weight of older observations if exponential decay is enabled |
avglim | nonnegative limit on observation number before the exponential decay starts, only relevant if exponential decay is enabled |
nactions | the positive number of possible actions |
initseed | initial random seed |
Definition at line 275 of file bandit_epsgreedy.c.
References assert(), BMSallocBlockMemory, BMSallocBlockMemoryArray, eps, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, and SCIPbanditCreate().
Referenced by SCIPcreateBanditEpsgreedy().
SCIP_RETCODE SCIPincludeBanditvtableEpsgreedy | ( | SCIP * | scip | ) |
creates the epsilon greedy bandit algorithm includes it in SCIP
scip | SCIP data structure |
Definition at line 374 of file bandit_epsgreedy.c.
References BANDIT_NAME, SCIP_CALL, SCIP_OKAY, and SCIPincludeBanditvtable().
Referenced by SCIPincludeCorePlugins().