methods for UCB bandit selection
Definition in file bandit_ucb.c.
#include "scip/bandit.h"#include "scip/bandit_ucb.h"#include "scip/pub_bandit.h"#include "scip/pub_message.h"#include "scip/pub_misc.h"#include "scip/pub_misc_sort.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 "ucb" |
| #define | NUMEPS 1e-6 |
Functions | |
| static SCIP_RETCODE | dataReset (BMS_BUFMEM *bufmem, SCIP_BANDIT *ucb, SCIP_BANDITDATA *banditdata, SCIP_Real *priorities, int nactions) |
| SCIP_DECL_BANDITFREE (SCIPbanditFreeUcb) | |
| SCIP_DECL_BANDITSELECT (SCIPbanditSelectUcb) | |
| SCIP_DECL_BANDITUPDATE (SCIPbanditUpdateUcb) | |
| SCIP_DECL_BANDITRESET (SCIPbanditResetUcb) | |
| SCIP_Real | SCIPgetConfidenceBoundUcb (SCIP_BANDIT *ucb, int action) |
| int * | SCIPgetStartPermutationUcb (SCIP_BANDIT *ucb) |
| SCIP_RETCODE | SCIPbanditCreateUcb (BMS_BLKMEM *blkmem, BMS_BUFMEM *bufmem, SCIP_BANDITVTABLE *vtable, SCIP_BANDIT **ucb, SCIP_Real *priorities, SCIP_Real alpha, int nactions, unsigned int initseed) |
| SCIP_RETCODE | SCIPcreateBanditUcb (SCIP *scip, SCIP_BANDIT **ucb, SCIP_Real *priorities, SCIP_Real alpha, int nactions, unsigned int initseed) |
| SCIP_RETCODE | SCIPincludeBanditvtableUcb (SCIP *scip) |
| #define BANDIT_NAME "ucb" |
Definition at line 44 of file bandit_ucb.c.
| #define NUMEPS 1e-6 |
Definition at line 45 of file bandit_ucb.c.
Referenced by dataReset(), and SCIP_DECL_BANDITSELECT().
|
static |
data reset method
| bufmem | buffer memory |
| ucb | ucb bandit algorithm |
| banditdata | UCB bandit data structure |
| priorities | priorities for start permutation, or NULL |
| nactions | number of actions |
Definition at line 68 of file bandit_ucb.c.
References assert(), BMSclearMemoryArray, BMSduplicateBufferMemoryArray, BMSfreeBufferMemoryArray, i, NULL, NUMEPS, SCIP_ALLOC, SCIP_OKAY, SCIP_Real, SCIPbanditGetRandnumgen(), SCIPrandomGetReal(), SCIPrandomPermuteIntArray(), and SCIPsortDownRealInt().
Referenced by SCIP_DECL_BANDITRESET().
| SCIP_DECL_BANDITFREE | ( | SCIPbanditFreeUcb | ) |
callback to free bandit specific data structures
Definition at line 125 of file bandit_ucb.c.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArray, NULL, SCIP_OKAY, SCIPbanditGetData(), SCIPbanditGetNActions(), and SCIPbanditSetData().
| SCIP_DECL_BANDITSELECT | ( | SCIPbanditSelectUcb | ) |
selection callback for bandit selector
Definition at line 146 of file bandit_ucb.c.
References assert(), EPSEQ, EPSGT, i, LOG1P, NULL, NUMEPS, SCIP_OKAY, SCIP_Real, SCIPbanditGetData(), SCIPbanditGetNActions(), SCIPbanditGetRandnumgen(), SCIPrandomGetReal(), and selection.
| SCIP_DECL_BANDITUPDATE | ( | SCIPbanditUpdateUcb | ) |
update callback for bandit algorithm
Definition at line 217 of file bandit_ucb.c.
References assert(), NULL, SCIP_OKAY, SCIP_Real, SCIPbanditGetData(), SCIPbanditGetNActions(), and selection.
| SCIP_DECL_BANDITRESET | ( | SCIPbanditResetUcb | ) |
reset callback for bandit algorithm
Definition at line 240 of file bandit_ucb.c.
References assert(), dataReset(), NULL, SCIP_CALL, SCIP_OKAY, SCIPbanditGetData(), and SCIPbanditGetNActions().
| SCIP_RETCODE SCIPbanditCreateUcb | ( | BMS_BLKMEM * | blkmem, |
| BMS_BUFMEM * | bufmem, | ||
| SCIP_BANDITVTABLE * | vtable, | ||
| SCIP_BANDIT ** | ucb, | ||
| SCIP_Real * | priorities, | ||
| SCIP_Real | alpha, | ||
| int | nactions, | ||
| unsigned int | initseed ) |
internal method to create and reset UCB bandit algorithm
| blkmem | block memory |
| bufmem | buffer memory |
| vtable | virtual function table for UCB bandit algorithm |
| ucb | pointer to store bandit algorithm |
| priorities | nonnegative priorities for each action, or NULL if not needed |
| alpha | parameter to increase confidence width |
| nactions | the positive number of actions for this bandit algorithm |
| initseed | initial random seed |
Definition at line 303 of file bandit_ucb.c.
References alpha, assert(), BMSallocBlockMemory, BMSallocBlockMemoryArray, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPbanditCreate(), and SCIPerrorMessage.
Referenced by SCIPcreateBanditUcb().
| SCIP_RETCODE SCIPincludeBanditvtableUcb | ( | SCIP * | scip | ) |
include virtual function table for UCB bandit algorithms
| scip | SCIP data structure |
Definition at line 362 of file bandit_ucb.c.
References assert(), BANDIT_NAME, NULL, SCIP_CALL, SCIP_OKAY, and SCIPincludeBanditvtable().
Referenced by SCIPincludeCorePlugins().