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.