Black Scholes TensorFlow v2 Upgrade

In my previous blog post I showed how to use TensorFlow to price options using Black Scholes and running a Monte Carlo Simulation. Today, I am going to show how I was able to convert that code to the pre release of TensorFlow v2.

The notebook is located here: MonteCarloBlackScholes-TF2.ipynb

The largest change was moving from using Sessions to using Functions with the addition of eager execution. There were some stumbling blocks but once I went through a few changes it all made sense and should be easy for any future upgrades.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s