-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First cut of geometric asian pricer #82
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This is a very nice contributions. Just a bunch of minor comments
t2 = tf.reduce_sum(tf.map_fn(lambda x: tf.minimum(*tf.meshgrid(x, tf.transpose(x))), | ||
tf.transpose(sampling_times)), [1,2]) / sample_count**2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here use tf.vectorized_map and set fallback_to_while_loop
to False. This should automatically vectorize what you want to do and provide significant speed up on a GPU device
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, could you please add a comment explaining what is achieved here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to vectorized_map
I've added an explanation comment above - let me know if this works or if you have a standard way of formatting math comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Could you please squash the commits so I can push to the library.
First cut of geometric asian pricer Code review updates
0b6190a
to
f9886f7
Compare
Thanks @jackgillett101 This is now submitted! |
Geometric asian option pricer under black scholes, this pricer transforms the asian problem into an equivalent vanilla problem and uses the vanilla pricer to price.
Affects this issue: #56