Created
January 14, 2019 11:10
-
-
Save talolard/2fc7334f8dc491b582e918b1a0bfd600 to your computer and use it in GitHub Desktop.
Sampling a portfolio from a dirichlet distribution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.alphas= tf.contrib.layers.fully_connected( | |
inputs=l2, | |
num_outputs=num_stocks+1, | |
activation_fn=tf.nn.relu, | |
weights_initializer=tf.initializers.glorot_uniform) | |
self.alphas +=1 | |
self.dirichlet = tfp.distributions.Dirichlet(self.alphas) | |
self.action = self.dirichlet._sample_n(1) | |
self.action = tf.squeeze(self.action) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment