Arms.Arm module

Base class for an arm class.

class Arms.Arm.Arm(lower=0.0, amplitude=1.0)[source]

Bases: object

Base class for an arm class.

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

Base class for an arm class.

lower = None

Lower value of rewards

amplitude = None

Amplitude of value of rewards

min = None

Lower value of rewards

max = None

Higher value of rewards

property lower_amplitude

(lower, amplitude)


Return str(self).


Return repr(self).


Draw one random sample.

draw_nparray(shape=(1, ))[source]

Draw a numpy array of random samples, of a certain shape.

static kl(x, y)[source]

The kl(x, y) to use for this arm.

static oneLR(mumax, mu)[source]

One term of the Lai & Robbins lower bound for Gaussian arms: (mumax - mu) / KL(mu, mumax).

static oneHOI(mumax, mu)[source]

One term for the HOI factor for this arm.

__dict__ = mappingproxy({'__module__': 'Arms.Arm', '__doc__': ' Base class for an arm class.', '__init__': <function Arm.__init__>, 'lower_amplitude': <property object>, '__str__': <function Arm.__str__>, '__repr__': <function Arm.__repr__>, 'draw': <function Arm.draw>, 'oracle_draw': <function Arm.oracle_draw>, 'set_mean_param': <function Arm.set_mean_param>, 'draw_nparray': <function Arm.draw_nparray>, 'kl': <staticmethod object>, 'oneLR': <staticmethod object>, 'oneHOI': <staticmethod object>, '__dict__': <attribute '__dict__' of 'Arm' objects>, '__weakref__': <attribute '__weakref__' of 'Arm' objects>})
__module__ = 'Arms.Arm'

list of weak references to the object (if defined)