Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tensorflow as tf
- import tensorflow_probability as tfp
- tfd = tfp.distributions
- # Generate Particles
- tf.random.set_random_seed(rand_seed)
- np.random.RandomState(seed=rand_seed)
- state = np.array(pf['state'])
- state.shape = (num_st, )
- mvn = tfd.MultivariateNormalFullCovariance(loc=state, covariance_matrix=pf['state_cov'])
- particles = sess.run(mvn.sample(pf['Ns']))
- pf['particles'] = particles.T
- pf['weights'] = np.ones((pf['Ns'], 1))/pf['Ns']
- pf['Neff'] = list()
- pf['yVec'] = list()
- pf['yLow'] = list()
- pf['yHigh'] = list()
- pf['conf_low'] = 0.15
- pf['conf_high'] = 99.85
- pf_particles_list = []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement