Arms.Gaussian module¶
Gaussian distributed arm.
Example of creating an arm:
>>> import random; import numpy as np
>>> random.seed(0); np.random.seed(0)
>>> Gauss03 = Gaussian(0.3, 0.05) # small variance
>>> Gauss03
N(0.3, 0.05)
>>> Gauss03.mean
0.3
Examples of sampling from an arm:
>>> Gauss03.draw()
0.3470...
>>> Gauss03.draw_nparray(20)
array([0.388..., 0.320..., 0.348... , 0.412..., 0.393... ,
0.251..., 0.347..., 0.292..., 0.294..., 0.320...,
0.307..., 0.372..., 0.338..., 0.306..., 0.322...,
0.316..., 0.374..., 0.289..., 0.315..., 0.257...])
-
class
Arms.Gaussian.
Gaussian
(mu, sigma=0.05, mini=0, maxi=1)[source]¶ Bases:
Arms.Arm.Arm
Gaussian distributed arm, possibly truncated.
Default is to truncate into [0, 1] (so Gaussian.draw() is in [0, 1]).
-
mu
= None¶ Mean of Gaussian arm
-
mean
= None¶ Mean of Gaussian arm
-
sigma
= None¶ Variance of Gaussian arm
-
min
= None¶ Lower value of rewards
-
max
= None¶ Higher value of rewards
-
property
lower_amplitude
¶ (lower, amplitude)
-
oneLR
(mumax, mu)[source]¶ One term of the Lai & Robbins lower bound for Gaussian arms: (mumax - mu) / KL(mu, mumax).
-
__module__
= 'Arms.Gaussian'¶
-
class
Arms.Gaussian.
Gaussian_0_1
(mu, sigma=0.05, mini=0, maxi=1)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, truncated to [0, 1].
-
__module__
= 'Arms.Gaussian'¶
-
-
class
Arms.Gaussian.
Gaussian_0_2
(mu, sigma=0.1, mini=0, maxi=2)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, truncated to [0, 2].
-
__module__
= 'Arms.Gaussian'¶
-
-
class
Arms.Gaussian.
Gaussian_0_5
(mu, sigma=0.5, mini=0, maxi=5)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, truncated to [0, 5].
-
__module__
= 'Arms.Gaussian'¶
-
-
class
Arms.Gaussian.
Gaussian_0_10
(mu, sigma=1, mini=0, maxi=10)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, truncated to [0, 10].
-
__module__
= 'Arms.Gaussian'¶
-
-
class
Arms.Gaussian.
Gaussian_0_100
(mu, sigma=5, mini=0, maxi=100)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, truncated to [0, 100].
-
__module__
= 'Arms.Gaussian'¶
-
-
class
Arms.Gaussian.
Gaussian_m1_1
(mu, sigma=0.1, mini=-1, maxi=1)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, truncated to [-1, 1].
-
__module__
= 'Arms.Gaussian'¶
-
-
class
Arms.Gaussian.
Gaussian_m2_2
(mu, sigma=0.25, mini=-2, maxi=2)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, truncated to [-2, 2].
-
__module__
= 'Arms.Gaussian'¶
-
-
class
Arms.Gaussian.
Gaussian_m5_5
(mu, sigma=1, mini=-5, maxi=5)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, truncated to [-5, 5].
-
__module__
= 'Arms.Gaussian'¶
-
-
class
Arms.Gaussian.
Gaussian_m10_10
(mu, sigma=2, mini=-10, maxi=10)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, truncated to [-10, 10].
-
__module__
= 'Arms.Gaussian'¶
-
-
class
Arms.Gaussian.
Gaussian_m100_100
(mu, sigma=10, mini=-100, maxi=100)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, truncated to [-100, 100].
-
__module__
= 'Arms.Gaussian'¶
-
-
class
Arms.Gaussian.
UnboundedGaussian
(mu, sigma=1)[source]¶ Bases:
Arms.Gaussian.Gaussian
Gaussian distributed arm, not truncated, ie. supported in (-oo, oo).
-
__module__
= 'Arms.Gaussian'¶
-