Using PyTorch for Neural Networks to Create Black-
Scholes Model Option Pricer
In this exercise, our aim is to learn the Black-Scholes European call option price formula via a deep
neural network. Recall the Black-Scholes European call option price formula
We first create a sample dataset of model parameters by using moneynees S/K instead of S and K
separately. Thus, we create input features as
1. Moneyness: S/K with a narrow range: [0.5, 1.5] and a wide range: [0.4, 1.6]
2. Time to maturity: τ with a narrow range: [0.3, 0.95] and a wide range: [0.2, 1.1]
3. Risk free rate: r with a narrow range: [0.03, 0.08] and a wide range: [0.02, 0.1]
4. Volatility: σ with a narrow range: [0.02, 0.9] and a wide range: [0.01, 1.0]
1.1 Create the dataset
Create the dataset using the narrow and wide ranges via Latin Hypercube Sampling (LHS).
1.2 Read the dataset
If you cannot create the dataset, you can read it from the files [login to view URL] and
[login to view URL] available at:
[login to view URL]
The first column is V/K, second column is S/K, third column is τ, fourth column is r and the fifth
column is σ.
1.3 Divide the data into training, validation and test sets
Split the data into 80% training, 10% validation and 10% test sets, which are used for training,
validation and testing purposes, respectively.
1.4 Create a neural network
Ceate a neural network with 4 hidden layers, with 400 neurons in each hidden layer. Use the
Adam optimizer with a batch size of 1024. Initialize the first layer weights using Glorot_uniform
initialization. The recommended activation function is ReLu but you are free to choose any other
activation function which gives a better performance.
1
Hi
I have read your description carefully.
⭐
I have rich experiences in Python, Machine learning, AI, Deep learning, Image processing.
⭐
I worked on many similar projects.
I can guarantee the quality of the job.
Please kindly message me.
Thank you.