Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import tensorflow as tf
  2. import tensorflow_probability as tfp
  3. tfd = tfp.distributions
  4.  
  5. # Generate Particles
  6. tf.random.set_random_seed(rand_seed)
  7. np.random.RandomState(seed=rand_seed)
  8.  
  9. state = np.array(pf['state'])
  10. state.shape = (num_st, )
  11. mvn = tfd.MultivariateNormalFullCovariance(loc=state, covariance_matrix=pf['state_cov'])
  12. particles = sess.run(mvn.sample(pf['Ns']))
  13. pf['particles'] = particles.T
  14. pf['weights'] = np.ones((pf['Ns'], 1))/pf['Ns']
  15. pf['Neff'] = list()
  16. pf['yVec'] = list()
  17. pf['yLow'] = list()
  18. pf['yHigh'] = list()
  19. pf['conf_low'] = 0.15
  20. pf['conf_high'] = 99.85
  21. pf_particles_list = []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement