Esempio n. 1
0
def mixed_weight_particle_list():
    p_list = [
        Particle({
            'a': 1,
            'b': 2
        }, i, -.2) for i in np.arange(.1, .5, .1)
    ]
    return p_list
Esempio n. 2
0
def particle():
    particle = Particle({'a': 1, 'b': 2}, 0.2, -0.2)
    return particle
 def when_wrong_weight_type(self):
     bad_weight_type = 'bad'
     return Particle(self.params, bad_weight_type, self.log_like)
 def when_zero_log_like(self):
     edge_case_log_like = 0.0
     return Particle(self.params, self.log_weight, edge_case_log_like)
 def when_pos_log_like(self):
     pos_log_like = 0.1
     return Particle(self.params, self.log_weight, pos_log_like)
 def when_wrong_param_type(self):
     bad_param_type = [1, 2]
     return Particle(bad_param_type, self.log_weight, self.log_like)
 def when_good_particle(self):
     return Particle(self.params, self.log_weight, self.log_like)
Esempio n. 8
0
def particle_list():
    particle = Particle({'a': 1, 'b': 2}, 0.2, -0.2)
    return 5 * [particle]
Esempio n. 9
0
def linear_particle_list():
    a = np.arange(0, 20)
    b = [2 * val + np.random.normal(0, 1) for val in a]
    w = 0.1
    p_list = [Particle({'a': a[i], 'b': b[i]}, w, -.2) for i in a]
    return p_list
Esempio n. 10
0
def mixed_particle_list():
    particle_1 = Particle({'a': 1, 'b': 2}, -0.2, -0.2)
    particle_2 = Particle({'a': 2, 'b': 4}, -0.2, -0.2)
    list_1 = [particle_1.copy() for i in range(3)]
    list_2 = [particle_2.copy() for i in range(2)]
    return list_1 + list_2
Esempio n. 11
0
def particle_list():
    particle = Particle({'a': 1, 'b': 2}, 0.2, -0.2)
    return [particle.copy() for i in range(5)]