Policies.Experimentals.UCBjulia module

The UCB policy for bounded bandits, with UCB indexes computed with Julia. Reference: [Lai & Robbins, 1985].

Warning

Using a Julia function from Python will not speed up anything, as there is a lot of overhead in the “bridge” protocol used by pyjulia. The idea of using naively a tiny Julia function to speed up computations is basically useless.

A naive benchmark showed that in this approach, UCBjulia (used withing Python) is about 125 times slower (!) than UCB.

Warning

This is only experimental, and purely useless. See https://github.com/SMPyBandits/SMPyBandits/issues/98

class Policies.Experimentals.UCBjulia.UCBjulia(nbArms, lower=0.0, amplitude=1.0)[source]

Bases: IndexPolicy.IndexPolicy

The UCB policy for bounded bandits, with UCB indexes computed with Julia. Reference: [Lai & Robbins, 1985].

Warning

This is only experimental, and purely useless. See https://github.com/SMPyBandits/SMPyBandits/issues/98

__init__(nbArms, lower=0.0, amplitude=1.0)[source]

Will fail directly if the bridge with julia is unavailable or buggy.

__module__ = 'Policies.Experimentals.UCBjulia'
computeIndex(arm)[source]

Compute the current index, at time t and after \(N_k(t)\) pulls of arm k:

\[I_k(t) = \frac{X_k(t)}{N_k(t)} + \sqrt{\frac{2 \log(t)}{N_k(t)}}.\]