Instead of learning maps from parameters to prices as we have seen in a first approach, or learning directly the solution of the inverse problem, see Andres Hernandez's work Model calibration with neural networks, or work of Cuchiero et al., we can in case of local stochastic volatility models choose a third approach (this is joint work with Christa Cuchiero and Wahid Khosrawi-Sardroudi):
Consider the model $$ dS_t = \alpha_t \sigma(t,S_t) dW_t $$ with initial value $ S_0 $. We can set up the problem to infer the local volatility function $ \sigma $ from derivatives's prices in the following machine learning fashion: try to find a function $ \sigma $, given as neural network, and hedges $ H^{(K,T)} $ such that $$ \sum_{(K,T)} E\big[{((S_T-K)_+ - C_{\text{market}}(K,T) - (H^{(K,T)}\bullet S)_t)}^2\big] \rightarrow \text{min!} $$ Notice that the sum is running over a finite set of price data points. The problem can possibly solve the calibration problem but one has to learn the local volatility function and the hedges simultanously.
Let us see in the sequel if this can work out. We shall use notation which reminds the above formulation.
import numpy as np
import tensorflow as tf
from keras.models import Sequential
from keras.layers import Input, Dense, Conv2D, Concatenate, Dropout, Subtract, \
Flatten, MaxPooling2D, Multiply, Lambda, Add, Dot
from keras.backend import constant
from keras import optimizers
from keras.engine.topology import Layer
from keras.models import Model
from keras.layers import Input
from keras import initializers
from keras.constraints import max_norm
import keras.backend as K
First we create two identical models where either only hedges or local volatilities can be trained.
m = 10 # layer dimension
n = 2 # number of layers for local volatility
N = 20 # time discretization (should fit to maturities)
maturities = [1.] # list of maturities in years
T = 1.0
layers = []
layersatT = []
for j in range(len(maturities)):
for i in range(n):
if i < 1:
nodes = m
else:
nodes = 1
layer = Dense(nodes, activation='tanh', trainable=False,
kernel_initializer=initializers.RandomNormal(0,1),#kernel_initializer='random_normal',
bias_initializer='random_normal')
layersatT = layersatT + [layer]
layers = layers + [layersatT]
#P = {(1.0,1.0): 0.4, (1.1,1.0):0.2, (0.9,1.0):0.5,
# (1.0,0.5): 0.2, (1.1,0.5):0.1, (0.9,0.5):0.3}
P= {(0.9, 0.5): 0.20042534,
(0.9, 1.0): 0.23559685,
(1.0, 0.5): 0.16312157,
(1.0, 1.0): 0.20771958,
(1.1, 0.5): 0.13154241,
(1.1, 1.0): 0.18236567}
hedges = {}
hedgeskey =[]
for key in P.keys():
for j in range(N):
hedge = Dense(nodes, activation='tanh', trainable=True,
kernel_initializer=initializers.RandomNormal(0,0.1),#kernel_initializer='random_normal',
bias_initializer='random_normal')
hedgeskey = hedgeskey + [hedge]
hedges[key] = hedgeskey
start = 0
keylist = list(P.keys())
price = Input(shape=(1,))
hedgepf = [Input(shape=(1,)) for l in range(len(P.keys()))]
inputs = [price] + hedgepf
inputshelper = []
hedgeratio = {}
hedge = {}
pricekey = [0 for l in range(len(P.keys()))]
normal = tf.distributions.Normal(loc=0., scale=1.)
def BS(x):
price=x[0]
vola=x[1]
return normal.cdf((K.log(K.abs(price)/key[0])-0.5*(key[1]-j*T/N)*vola**2)/(0.0001+np.sqrt(key[1]-j*T/N)*vola))
# increases computational time
for i in range(len(maturities)):
for j in range(start,N):
if maturities[i] >= j*T/N:
helper0 = layers[i][0](price)
for k in range(1,2):
helper0 = layers[i][k](helper0) # local vol applied to price at time j*T/N
BMincr = Input(shape=(1,)) # BM increment
stochvol = Input(shape=(1,)) # stochvol value
helper1 = Multiply()([helper0,BMincr])
helper1 = Lambda(lambda x: x * np.sqrt(T/N))(helper1)
priceincr = Multiply()([helper1,stochvol]) # new price increment
for l in range(len(P.keys())):
key = keylist[l]
hedgeratio[key] = hedges[key][j](price)
BSstrategy = Lambda(BS)([price,helper0])
hedgeratio[key] = Add()([hedgeratio[key],BSstrategy])
hedge[key] = Multiply()([priceincr,hedgeratio[key]])
hedgepf[l] = Add()([hedgepf[l],hedge[key]])
if key[1]==((j+1)*T/N): # the option expires
helper2 = Lambda(lambda x : 0.5*(abs(x-key[0])+x-key[0]))(price)
helper2 = Subtract()([helper2,hedgepf[l]]) # payoff minus hedge
pricekey[l] = helper2
price = Add()([price,priceincr]) #new price after one time step
inputshelper = inputshelper + [stochvol]
inputs = inputs + [BMincr]
else:
start = j
break
inputs = inputs + inputshelper
pricekey = Concatenate()(pricekey)
localvol_trainhedge = Model(inputs=inputs, outputs=pricekey)
Pay attention here: don't jump back and forth when defining models since layer lists come with the same names, so the order of execution is important!
layers = []
layersatT = []
for j in range(len(maturities)):
for i in range(2):
if i < 1:
nodes = m
else:
nodes = 1
layer = Dense(nodes, activation='tanh', trainable=True,
kernel_initializer=initializers.RandomNormal(0,1),#kernel_initializer='random_normal',
bias_initializer='random_normal')
layersatT = layersatT + [layer1]
layers = layers + [layersatT]
hedges = {}
hedgeskey =[]
for key in P.keys():
for j in range(N):
hedge = Dense(nodes, activation='tanh', trainable=False,
kernel_initializer=initializers.RandomNormal(0,0.1),#kernel_initializer='random_normal',
bias_initializer='random_normal')
hedgeskey = hedgeskey + [hedge]
hedges[key] = hedgeskey
start = 0
keylist = list(P.keys())
price = Input(shape=(1,))
hedgepf = [Input(shape=(1,)) for l in range(len(P.keys()))]
inputs = [price] + hedgepf
inputshelper = []
hedgeratio = {}
hedge = {}
pricekey = [0 for l in range(len(P.keys()))]
for i in range(len(maturities)):
for j in range(start,N):
if maturities[i] >= j*T/N:
layers[i][0].trainable=True
helper0 = layers[i][0](price)
for k in range(1,2):
layers[i][k].trainable=True
helper0 = layers[i][k](helper0)
BMincr = Input(shape=(1,))
stochvol = Input(shape=(1,))
helper1 = Multiply()([helper0,BMincr])
helper1 = Lambda(lambda x: x * np.sqrt(T/N))(helper1)
priceincr = Multiply()([helper1,stochvol])
for l in range(len(P.keys())):
key = keylist[l]
hedges[key][j].trainable=False
hedgeratio[key] = hedges[key][j](price)
BSstrategy = Lambda(BS)([price,helper0])
hedgeratio[key] = Add()([hedgeratio[key],BSstrategy])
hedge[key] = Multiply()([priceincr,hedgeratio[key]])
hedgepf[l] = Add()([hedgepf[l],hedge[key]])
if key[1]==((j+1)*T/N):
helper2 = Lambda(lambda x : 0.5*(abs(x-key[0])+x-key[0]))(price)
helper2 = Subtract()([helper2,hedgepf[l]])
pricekey[l] = helper2
price = Add()([price,priceincr])
inputshelper = inputshelper + [stochvol]
inputs = inputs + [BMincr]
else:
start = j
break
inputs = inputs + inputshelper
pricekey = Concatenate()(pricekey)
localvol_trainlocvol = Model(inputs=inputs, outputs=pricekey)
localvol_trainlocvol.summary()
____________________________________________________________________________________________________ Layer (type) Output Shape Param # Connected to ==================================================================================================== input_1391 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ dense_3173 (Dense) (None, 10) 20 input_1391[0][0] add_7088[0][0] add_7101[0][0] add_7114[0][0] add_7127[0][0] add_7140[0][0] add_7153[0][0] add_7166[0][0] add_7179[0][0] add_7192[0][0] add_7205[0][0] add_7218[0][0] add_7231[0][0] add_7244[0][0] add_7257[0][0] add_7270[0][0] add_7283[0][0] add_7296[0][0] add_7309[0][0] add_7322[0][0] ____________________________________________________________________________________________________ dense_3174 (Dense) (None, 1) 11 dense_3173[0][0] dense_3173[1][0] dense_3173[2][0] dense_3173[3][0] dense_3173[4][0] dense_3173[5][0] dense_3173[6][0] dense_3173[7][0] dense_3173[8][0] dense_3173[9][0] dense_3173[10][0] dense_3173[11][0] dense_3173[12][0] dense_3173[13][0] dense_3173[14][0] dense_3173[15][0] dense_3173[16][0] dense_3173[17][0] dense_3173[18][0] dense_3173[19][0] ____________________________________________________________________________________________________ input_1398 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4654 (Multiply) (None, 1) 0 dense_3174[0][0] input_1398[0][0] ____________________________________________________________________________________________________ lambda_3886 (Lambda) (None, 1) 0 multiply_4654[0][0] ____________________________________________________________________________________________________ input_1399 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4655 (Multiply) (None, 1) 0 lambda_3886[0][0] input_1399[0][0] ____________________________________________________________________________________________________ add_7088 (Add) (None, 1) 0 input_1391[0][0] multiply_4655[0][0] ____________________________________________________________________________________________________ input_1400 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4662 (Multiply) (None, 1) 0 dense_3174[1][0] input_1400[0][0] ____________________________________________________________________________________________________ lambda_3893 (Lambda) (None, 1) 0 multiply_4662[0][0] ____________________________________________________________________________________________________ input_1401 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4663 (Multiply) (None, 1) 0 lambda_3893[0][0] input_1401[0][0] ____________________________________________________________________________________________________ add_7101 (Add) (None, 1) 0 add_7088[0][0] multiply_4663[0][0] ____________________________________________________________________________________________________ input_1402 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4670 (Multiply) (None, 1) 0 dense_3174[2][0] input_1402[0][0] ____________________________________________________________________________________________________ lambda_3900 (Lambda) (None, 1) 0 multiply_4670[0][0] ____________________________________________________________________________________________________ input_1403 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4671 (Multiply) (None, 1) 0 lambda_3900[0][0] input_1403[0][0] ____________________________________________________________________________________________________ add_7114 (Add) (None, 1) 0 add_7101[0][0] multiply_4671[0][0] ____________________________________________________________________________________________________ input_1404 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4678 (Multiply) (None, 1) 0 dense_3174[3][0] input_1404[0][0] ____________________________________________________________________________________________________ lambda_3907 (Lambda) (None, 1) 0 multiply_4678[0][0] ____________________________________________________________________________________________________ input_1405 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4679 (Multiply) (None, 1) 0 lambda_3907[0][0] input_1405[0][0] ____________________________________________________________________________________________________ add_7127 (Add) (None, 1) 0 add_7114[0][0] multiply_4679[0][0] ____________________________________________________________________________________________________ input_1406 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4686 (Multiply) (None, 1) 0 dense_3174[4][0] input_1406[0][0] ____________________________________________________________________________________________________ lambda_3914 (Lambda) (None, 1) 0 multiply_4686[0][0] ____________________________________________________________________________________________________ input_1407 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4687 (Multiply) (None, 1) 0 lambda_3914[0][0] input_1407[0][0] ____________________________________________________________________________________________________ add_7140 (Add) (None, 1) 0 add_7127[0][0] multiply_4687[0][0] ____________________________________________________________________________________________________ input_1408 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4694 (Multiply) (None, 1) 0 dense_3174[5][0] input_1408[0][0] ____________________________________________________________________________________________________ lambda_3921 (Lambda) (None, 1) 0 multiply_4694[0][0] ____________________________________________________________________________________________________ input_1409 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4695 (Multiply) (None, 1) 0 lambda_3921[0][0] input_1409[0][0] ____________________________________________________________________________________________________ add_7153 (Add) (None, 1) 0 add_7140[0][0] multiply_4695[0][0] ____________________________________________________________________________________________________ input_1410 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4702 (Multiply) (None, 1) 0 dense_3174[6][0] input_1410[0][0] ____________________________________________________________________________________________________ lambda_3928 (Lambda) (None, 1) 0 multiply_4702[0][0] ____________________________________________________________________________________________________ input_1411 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4703 (Multiply) (None, 1) 0 lambda_3928[0][0] input_1411[0][0] ____________________________________________________________________________________________________ add_7166 (Add) (None, 1) 0 add_7153[0][0] multiply_4703[0][0] ____________________________________________________________________________________________________ input_1412 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4710 (Multiply) (None, 1) 0 dense_3174[7][0] input_1412[0][0] ____________________________________________________________________________________________________ lambda_3935 (Lambda) (None, 1) 0 multiply_4710[0][0] ____________________________________________________________________________________________________ input_1413 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4711 (Multiply) (None, 1) 0 lambda_3935[0][0] input_1413[0][0] ____________________________________________________________________________________________________ add_7179 (Add) (None, 1) 0 add_7166[0][0] multiply_4711[0][0] ____________________________________________________________________________________________________ input_1414 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4718 (Multiply) (None, 1) 0 dense_3174[8][0] input_1414[0][0] ____________________________________________________________________________________________________ lambda_3942 (Lambda) (None, 1) 0 multiply_4718[0][0] ____________________________________________________________________________________________________ input_1415 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4719 (Multiply) (None, 1) 0 lambda_3942[0][0] input_1415[0][0] ____________________________________________________________________________________________________ add_7192 (Add) (None, 1) 0 add_7179[0][0] multiply_4719[0][0] ____________________________________________________________________________________________________ input_1416 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4726 (Multiply) (None, 1) 0 dense_3174[9][0] input_1416[0][0] ____________________________________________________________________________________________________ lambda_3949 (Lambda) (None, 1) 0 multiply_4726[0][0] ____________________________________________________________________________________________________ input_1417 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4727 (Multiply) (None, 1) 0 lambda_3949[0][0] input_1417[0][0] ____________________________________________________________________________________________________ add_7205 (Add) (None, 1) 0 add_7192[0][0] multiply_4727[0][0] ____________________________________________________________________________________________________ input_1418 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4734 (Multiply) (None, 1) 0 dense_3174[10][0] input_1418[0][0] ____________________________________________________________________________________________________ lambda_3959 (Lambda) (None, 1) 0 multiply_4734[0][0] ____________________________________________________________________________________________________ input_1419 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4735 (Multiply) (None, 1) 0 lambda_3959[0][0] input_1419[0][0] ____________________________________________________________________________________________________ add_7218 (Add) (None, 1) 0 add_7205[0][0] multiply_4735[0][0] ____________________________________________________________________________________________________ input_1420 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4742 (Multiply) (None, 1) 0 dense_3174[11][0] input_1420[0][0] ____________________________________________________________________________________________________ lambda_3966 (Lambda) (None, 1) 0 multiply_4742[0][0] ____________________________________________________________________________________________________ input_1421 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4743 (Multiply) (None, 1) 0 lambda_3966[0][0] input_1421[0][0] ____________________________________________________________________________________________________ add_7231 (Add) (None, 1) 0 add_7218[0][0] multiply_4743[0][0] ____________________________________________________________________________________________________ input_1422 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4750 (Multiply) (None, 1) 0 dense_3174[12][0] input_1422[0][0] ____________________________________________________________________________________________________ lambda_3973 (Lambda) (None, 1) 0 multiply_4750[0][0] ____________________________________________________________________________________________________ input_1423 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4751 (Multiply) (None, 1) 0 lambda_3973[0][0] input_1423[0][0] ____________________________________________________________________________________________________ add_7244 (Add) (None, 1) 0 add_7231[0][0] multiply_4751[0][0] ____________________________________________________________________________________________________ input_1424 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4758 (Multiply) (None, 1) 0 dense_3174[13][0] input_1424[0][0] ____________________________________________________________________________________________________ lambda_3980 (Lambda) (None, 1) 0 multiply_4758[0][0] ____________________________________________________________________________________________________ input_1425 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4759 (Multiply) (None, 1) 0 lambda_3980[0][0] input_1425[0][0] ____________________________________________________________________________________________________ add_7257 (Add) (None, 1) 0 add_7244[0][0] multiply_4759[0][0] ____________________________________________________________________________________________________ input_1426 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4766 (Multiply) (None, 1) 0 dense_3174[14][0] input_1426[0][0] ____________________________________________________________________________________________________ lambda_3987 (Lambda) (None, 1) 0 multiply_4766[0][0] ____________________________________________________________________________________________________ input_1427 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4767 (Multiply) (None, 1) 0 lambda_3987[0][0] input_1427[0][0] ____________________________________________________________________________________________________ add_7270 (Add) (None, 1) 0 add_7257[0][0] multiply_4767[0][0] ____________________________________________________________________________________________________ input_1428 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4774 (Multiply) (None, 1) 0 dense_3174[15][0] input_1428[0][0] ____________________________________________________________________________________________________ lambda_3994 (Lambda) (None, 1) 0 multiply_4774[0][0] ____________________________________________________________________________________________________ input_1429 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4775 (Multiply) (None, 1) 0 lambda_3994[0][0] input_1429[0][0] ____________________________________________________________________________________________________ add_7283 (Add) (None, 1) 0 add_7270[0][0] multiply_4775[0][0] ____________________________________________________________________________________________________ input_1430 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ dense_3175 (Dense) (None, 1) 2 input_1391[0][0] input_1391[0][0] input_1391[0][0] input_1391[0][0] input_1391[0][0] input_1391[0][0] ____________________________________________________________________________________________________ multiply_4782 (Multiply) (None, 1) 0 dense_3174[16][0] input_1430[0][0] ____________________________________________________________________________________________________ lambda_3888 (Lambda) (None, 1) 0 input_1391[0][0] dense_3174[0][0] ____________________________________________________________________________________________________ lambda_3890 (Lambda) (None, 1) 0 input_1391[0][0] dense_3174[0][0] ____________________________________________________________________________________________________ lambda_3892 (Lambda) (None, 1) 0 input_1391[0][0] dense_3174[0][0] ____________________________________________________________________________________________________ dense_3176 (Dense) (None, 1) 2 add_7088[0][0] add_7088[0][0] add_7088[0][0] add_7088[0][0] add_7088[0][0] add_7088[0][0] ____________________________________________________________________________________________________ lambda_4001 (Lambda) (None, 1) 0 multiply_4782[0][0] ____________________________________________________________________________________________________ input_1431 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ add_7078 (Add) (None, 1) 0 dense_3175[1][0] lambda_3888[0][0] ____________________________________________________________________________________________________ lambda_3895 (Lambda) (None, 1) 0 add_7088[0][0] dense_3174[1][0] ____________________________________________________________________________________________________ add_7082 (Add) (None, 1) 0 dense_3175[3][0] lambda_3890[0][0] ____________________________________________________________________________________________________ lambda_3897 (Lambda) (None, 1) 0 add_7088[0][0] dense_3174[1][0] ____________________________________________________________________________________________________ add_7086 (Add) (None, 1) 0 dense_3175[5][0] lambda_3892[0][0] ____________________________________________________________________________________________________ lambda_3899 (Lambda) (None, 1) 0 add_7088[0][0] dense_3174[1][0] ____________________________________________________________________________________________________ dense_3177 (Dense) (None, 1) 2 add_7101[0][0] add_7101[0][0] add_7101[0][0] add_7101[0][0] add_7101[0][0] add_7101[0][0] ____________________________________________________________________________________________________ multiply_4783 (Multiply) (None, 1) 0 lambda_4001[0][0] input_1431[0][0] ____________________________________________________________________________________________________ input_1393 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4657 (Multiply) (None, 1) 0 multiply_4655[0][0] add_7078[0][0] ____________________________________________________________________________________________________ add_7091 (Add) (None, 1) 0 dense_3176[1][0] lambda_3895[0][0] ____________________________________________________________________________________________________ lambda_3902 (Lambda) (None, 1) 0 add_7101[0][0] dense_3174[2][0] ____________________________________________________________________________________________________ input_1395 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4659 (Multiply) (None, 1) 0 multiply_4655[0][0] add_7082[0][0] ____________________________________________________________________________________________________ add_7095 (Add) (None, 1) 0 dense_3176[3][0] lambda_3897[0][0] ____________________________________________________________________________________________________ lambda_3904 (Lambda) (None, 1) 0 add_7101[0][0] dense_3174[2][0] ____________________________________________________________________________________________________ input_1397 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4661 (Multiply) (None, 1) 0 multiply_4655[0][0] add_7086[0][0] ____________________________________________________________________________________________________ add_7099 (Add) (None, 1) 0 dense_3176[5][0] lambda_3899[0][0] ____________________________________________________________________________________________________ lambda_3906 (Lambda) (None, 1) 0 add_7101[0][0] dense_3174[2][0] ____________________________________________________________________________________________________ dense_3178 (Dense) (None, 1) 2 add_7114[0][0] add_7114[0][0] add_7114[0][0] add_7114[0][0] add_7114[0][0] add_7114[0][0] ____________________________________________________________________________________________________ add_7296 (Add) (None, 1) 0 add_7283[0][0] multiply_4783[0][0] ____________________________________________________________________________________________________ add_7079 (Add) (None, 1) 0 input_1393[0][0] multiply_4657[0][0] ____________________________________________________________________________________________________ multiply_4665 (Multiply) (None, 1) 0 multiply_4663[0][0] add_7091[0][0] ____________________________________________________________________________________________________ add_7104 (Add) (None, 1) 0 dense_3177[1][0] lambda_3902[0][0] ____________________________________________________________________________________________________ lambda_3909 (Lambda) (None, 1) 0 add_7114[0][0] dense_3174[3][0] ____________________________________________________________________________________________________ add_7083 (Add) (None, 1) 0 input_1395[0][0] multiply_4659[0][0] ____________________________________________________________________________________________________ multiply_4667 (Multiply) (None, 1) 0 multiply_4663[0][0] add_7095[0][0] ____________________________________________________________________________________________________ add_7108 (Add) (None, 1) 0 dense_3177[3][0] lambda_3904[0][0] ____________________________________________________________________________________________________ lambda_3911 (Lambda) (None, 1) 0 add_7114[0][0] dense_3174[3][0] ____________________________________________________________________________________________________ add_7087 (Add) (None, 1) 0 input_1397[0][0] multiply_4661[0][0] ____________________________________________________________________________________________________ multiply_4669 (Multiply) (None, 1) 0 multiply_4663[0][0] add_7099[0][0] ____________________________________________________________________________________________________ add_7112 (Add) (None, 1) 0 dense_3177[5][0] lambda_3906[0][0] ____________________________________________________________________________________________________ lambda_3913 (Lambda) (None, 1) 0 add_7114[0][0] dense_3174[3][0] ____________________________________________________________________________________________________ dense_3179 (Dense) (None, 1) 2 add_7127[0][0] add_7127[0][0] add_7127[0][0] add_7127[0][0] add_7127[0][0] add_7127[0][0] ____________________________________________________________________________________________________ add_7092 (Add) (None, 1) 0 add_7079[0][0] multiply_4665[0][0] ____________________________________________________________________________________________________ multiply_4673 (Multiply) (None, 1) 0 multiply_4671[0][0] add_7104[0][0] ____________________________________________________________________________________________________ add_7117 (Add) (None, 1) 0 dense_3178[1][0] lambda_3909[0][0] ____________________________________________________________________________________________________ lambda_3916 (Lambda) (None, 1) 0 add_7127[0][0] dense_3174[4][0] ____________________________________________________________________________________________________ add_7096 (Add) (None, 1) 0 add_7083[0][0] multiply_4667[0][0] ____________________________________________________________________________________________________ multiply_4675 (Multiply) (None, 1) 0 multiply_4671[0][0] add_7108[0][0] ____________________________________________________________________________________________________ add_7121 (Add) (None, 1) 0 dense_3178[3][0] lambda_3911[0][0] ____________________________________________________________________________________________________ lambda_3918 (Lambda) (None, 1) 0 add_7127[0][0] dense_3174[4][0] ____________________________________________________________________________________________________ add_7100 (Add) (None, 1) 0 add_7087[0][0] multiply_4669[0][0] ____________________________________________________________________________________________________ multiply_4677 (Multiply) (None, 1) 0 multiply_4671[0][0] add_7112[0][0] ____________________________________________________________________________________________________ add_7125 (Add) (None, 1) 0 dense_3178[5][0] lambda_3913[0][0] ____________________________________________________________________________________________________ lambda_3920 (Lambda) (None, 1) 0 add_7127[0][0] dense_3174[4][0] ____________________________________________________________________________________________________ dense_3180 (Dense) (None, 1) 2 add_7140[0][0] add_7140[0][0] add_7140[0][0] add_7140[0][0] add_7140[0][0] add_7140[0][0] ____________________________________________________________________________________________________ input_1432 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ add_7105 (Add) (None, 1) 0 add_7092[0][0] multiply_4673[0][0] ____________________________________________________________________________________________________ multiply_4681 (Multiply) (None, 1) 0 multiply_4679[0][0] add_7117[0][0] ____________________________________________________________________________________________________ add_7130 (Add) (None, 1) 0 dense_3179[1][0] lambda_3916[0][0] ____________________________________________________________________________________________________ lambda_3923 (Lambda) (None, 1) 0 add_7140[0][0] dense_3174[5][0] ____________________________________________________________________________________________________ add_7109 (Add) (None, 1) 0 add_7096[0][0] multiply_4675[0][0] ____________________________________________________________________________________________________ multiply_4683 (Multiply) (None, 1) 0 multiply_4679[0][0] add_7121[0][0] ____________________________________________________________________________________________________ add_7134 (Add) (None, 1) 0 dense_3179[3][0] lambda_3918[0][0] ____________________________________________________________________________________________________ lambda_3925 (Lambda) (None, 1) 0 add_7140[0][0] dense_3174[5][0] ____________________________________________________________________________________________________ add_7113 (Add) (None, 1) 0 add_7100[0][0] multiply_4677[0][0] ____________________________________________________________________________________________________ multiply_4685 (Multiply) (None, 1) 0 multiply_4679[0][0] add_7125[0][0] ____________________________________________________________________________________________________ add_7138 (Add) (None, 1) 0 dense_3179[5][0] lambda_3920[0][0] ____________________________________________________________________________________________________ lambda_3927 (Lambda) (None, 1) 0 add_7140[0][0] dense_3174[5][0] ____________________________________________________________________________________________________ dense_3181 (Dense) (None, 1) 2 add_7153[0][0] add_7153[0][0] add_7153[0][0] add_7153[0][0] add_7153[0][0] add_7153[0][0] ____________________________________________________________________________________________________ multiply_4790 (Multiply) (None, 1) 0 dense_3174[17][0] input_1432[0][0] ____________________________________________________________________________________________________ add_7118 (Add) (None, 1) 0 add_7105[0][0] multiply_4681[0][0] ____________________________________________________________________________________________________ multiply_4689 (Multiply) (None, 1) 0 multiply_4687[0][0] add_7130[0][0] ____________________________________________________________________________________________________ add_7143 (Add) (None, 1) 0 dense_3180[1][0] lambda_3923[0][0] ____________________________________________________________________________________________________ lambda_3930 (Lambda) (None, 1) 0 add_7153[0][0] dense_3174[6][0] ____________________________________________________________________________________________________ add_7122 (Add) (None, 1) 0 add_7109[0][0] multiply_4683[0][0] ____________________________________________________________________________________________________ multiply_4691 (Multiply) (None, 1) 0 multiply_4687[0][0] add_7134[0][0] ____________________________________________________________________________________________________ add_7147 (Add) (None, 1) 0 dense_3180[3][0] lambda_3925[0][0] ____________________________________________________________________________________________________ lambda_3932 (Lambda) (None, 1) 0 add_7153[0][0] dense_3174[6][0] ____________________________________________________________________________________________________ add_7126 (Add) (None, 1) 0 add_7113[0][0] multiply_4685[0][0] ____________________________________________________________________________________________________ multiply_4693 (Multiply) (None, 1) 0 multiply_4687[0][0] add_7138[0][0] ____________________________________________________________________________________________________ add_7151 (Add) (None, 1) 0 dense_3180[5][0] lambda_3927[0][0] ____________________________________________________________________________________________________ lambda_3934 (Lambda) (None, 1) 0 add_7153[0][0] dense_3174[6][0] ____________________________________________________________________________________________________ dense_3182 (Dense) (None, 1) 2 add_7166[0][0] add_7166[0][0] add_7166[0][0] add_7166[0][0] add_7166[0][0] add_7166[0][0] ____________________________________________________________________________________________________ lambda_4008 (Lambda) (None, 1) 0 multiply_4790[0][0] ____________________________________________________________________________________________________ input_1433 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ add_7131 (Add) (None, 1) 0 add_7118[0][0] multiply_4689[0][0] ____________________________________________________________________________________________________ multiply_4697 (Multiply) (None, 1) 0 multiply_4695[0][0] add_7143[0][0] ____________________________________________________________________________________________________ add_7156 (Add) (None, 1) 0 dense_3181[1][0] lambda_3930[0][0] ____________________________________________________________________________________________________ lambda_3937 (Lambda) (None, 1) 0 add_7166[0][0] dense_3174[7][0] ____________________________________________________________________________________________________ add_7135 (Add) (None, 1) 0 add_7122[0][0] multiply_4691[0][0] ____________________________________________________________________________________________________ multiply_4699 (Multiply) (None, 1) 0 multiply_4695[0][0] add_7147[0][0] ____________________________________________________________________________________________________ add_7160 (Add) (None, 1) 0 dense_3181[3][0] lambda_3932[0][0] ____________________________________________________________________________________________________ lambda_3939 (Lambda) (None, 1) 0 add_7166[0][0] dense_3174[7][0] ____________________________________________________________________________________________________ add_7139 (Add) (None, 1) 0 add_7126[0][0] multiply_4693[0][0] ____________________________________________________________________________________________________ multiply_4701 (Multiply) (None, 1) 0 multiply_4695[0][0] add_7151[0][0] ____________________________________________________________________________________________________ add_7164 (Add) (None, 1) 0 dense_3181[5][0] lambda_3934[0][0] ____________________________________________________________________________________________________ lambda_3941 (Lambda) (None, 1) 0 add_7166[0][0] dense_3174[7][0] ____________________________________________________________________________________________________ dense_3183 (Dense) (None, 1) 2 add_7179[0][0] add_7179[0][0] add_7179[0][0] add_7179[0][0] add_7179[0][0] add_7179[0][0] ____________________________________________________________________________________________________ multiply_4791 (Multiply) (None, 1) 0 lambda_4008[0][0] input_1433[0][0] ____________________________________________________________________________________________________ add_7144 (Add) (None, 1) 0 add_7131[0][0] multiply_4697[0][0] ____________________________________________________________________________________________________ multiply_4705 (Multiply) (None, 1) 0 multiply_4703[0][0] add_7156[0][0] ____________________________________________________________________________________________________ add_7169 (Add) (None, 1) 0 dense_3182[1][0] lambda_3937[0][0] ____________________________________________________________________________________________________ lambda_3944 (Lambda) (None, 1) 0 add_7179[0][0] dense_3174[8][0] ____________________________________________________________________________________________________ add_7148 (Add) (None, 1) 0 add_7135[0][0] multiply_4699[0][0] ____________________________________________________________________________________________________ multiply_4707 (Multiply) (None, 1) 0 multiply_4703[0][0] add_7160[0][0] ____________________________________________________________________________________________________ add_7173 (Add) (None, 1) 0 dense_3182[3][0] lambda_3939[0][0] ____________________________________________________________________________________________________ lambda_3946 (Lambda) (None, 1) 0 add_7179[0][0] dense_3174[8][0] ____________________________________________________________________________________________________ add_7152 (Add) (None, 1) 0 add_7139[0][0] multiply_4701[0][0] ____________________________________________________________________________________________________ multiply_4709 (Multiply) (None, 1) 0 multiply_4703[0][0] add_7164[0][0] ____________________________________________________________________________________________________ add_7177 (Add) (None, 1) 0 dense_3182[5][0] lambda_3941[0][0] ____________________________________________________________________________________________________ lambda_3948 (Lambda) (None, 1) 0 add_7179[0][0] dense_3174[8][0] ____________________________________________________________________________________________________ dense_3184 (Dense) (None, 1) 2 add_7192[0][0] add_7192[0][0] add_7192[0][0] add_7192[0][0] add_7192[0][0] add_7192[0][0] ____________________________________________________________________________________________________ add_7309 (Add) (None, 1) 0 add_7296[0][0] multiply_4791[0][0] ____________________________________________________________________________________________________ add_7157 (Add) (None, 1) 0 add_7144[0][0] multiply_4705[0][0] ____________________________________________________________________________________________________ multiply_4713 (Multiply) (None, 1) 0 multiply_4711[0][0] add_7169[0][0] ____________________________________________________________________________________________________ add_7182 (Add) (None, 1) 0 dense_3183[1][0] lambda_3944[0][0] ____________________________________________________________________________________________________ lambda_3952 (Lambda) (None, 1) 0 add_7192[0][0] dense_3174[9][0] ____________________________________________________________________________________________________ add_7161 (Add) (None, 1) 0 add_7148[0][0] multiply_4707[0][0] ____________________________________________________________________________________________________ multiply_4715 (Multiply) (None, 1) 0 multiply_4711[0][0] add_7173[0][0] ____________________________________________________________________________________________________ add_7186 (Add) (None, 1) 0 dense_3183[3][0] lambda_3946[0][0] ____________________________________________________________________________________________________ lambda_3955 (Lambda) (None, 1) 0 add_7192[0][0] dense_3174[9][0] ____________________________________________________________________________________________________ add_7165 (Add) (None, 1) 0 add_7152[0][0] multiply_4709[0][0] ____________________________________________________________________________________________________ multiply_4717 (Multiply) (None, 1) 0 multiply_4711[0][0] add_7177[0][0] ____________________________________________________________________________________________________ add_7190 (Add) (None, 1) 0 dense_3183[5][0] lambda_3948[0][0] ____________________________________________________________________________________________________ lambda_3958 (Lambda) (None, 1) 0 add_7192[0][0] dense_3174[9][0] ____________________________________________________________________________________________________ lambda_3887 (Lambda) (None, 1) 0 input_1391[0][0] dense_3174[0][0] ____________________________________________________________________________________________________ add_7170 (Add) (None, 1) 0 add_7157[0][0] multiply_4713[0][0] ____________________________________________________________________________________________________ multiply_4721 (Multiply) (None, 1) 0 multiply_4719[0][0] add_7182[0][0] ____________________________________________________________________________________________________ add_7195 (Add) (None, 1) 0 dense_3184[1][0] lambda_3952[0][0] ____________________________________________________________________________________________________ dense_3185 (Dense) (None, 1) 2 add_7205[0][0] add_7205[0][0] add_7205[0][0] ____________________________________________________________________________________________________ lambda_3961 (Lambda) (None, 1) 0 add_7205[0][0] dense_3174[10][0] ____________________________________________________________________________________________________ lambda_3889 (Lambda) (None, 1) 0 input_1391[0][0] dense_3174[0][0] ____________________________________________________________________________________________________ add_7174 (Add) (None, 1) 0 add_7161[0][0] multiply_4715[0][0] ____________________________________________________________________________________________________ multiply_4723 (Multiply) (None, 1) 0 multiply_4719[0][0] add_7186[0][0] ____________________________________________________________________________________________________ add_7199 (Add) (None, 1) 0 dense_3184[3][0] lambda_3955[0][0] ____________________________________________________________________________________________________ lambda_3963 (Lambda) (None, 1) 0 add_7205[0][0] dense_3174[10][0] ____________________________________________________________________________________________________ lambda_3891 (Lambda) (None, 1) 0 input_1391[0][0] dense_3174[0][0] ____________________________________________________________________________________________________ add_7178 (Add) (None, 1) 0 add_7165[0][0] multiply_4717[0][0] ____________________________________________________________________________________________________ multiply_4725 (Multiply) (None, 1) 0 multiply_4719[0][0] add_7190[0][0] ____________________________________________________________________________________________________ add_7203 (Add) (None, 1) 0 dense_3184[5][0] lambda_3958[0][0] ____________________________________________________________________________________________________ lambda_3965 (Lambda) (None, 1) 0 add_7205[0][0] dense_3174[10][0] ____________________________________________________________________________________________________ add_7076 (Add) (None, 1) 0 dense_3175[0][0] lambda_3887[0][0] ____________________________________________________________________________________________________ lambda_3894 (Lambda) (None, 1) 0 add_7088[0][0] dense_3174[1][0] ____________________________________________________________________________________________________ input_1434 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ add_7183 (Add) (None, 1) 0 add_7170[0][0] multiply_4721[0][0] ____________________________________________________________________________________________________ multiply_4729 (Multiply) (None, 1) 0 multiply_4727[0][0] add_7195[0][0] ____________________________________________________________________________________________________ add_7208 (Add) (None, 1) 0 dense_3185[1][0] lambda_3961[0][0] ____________________________________________________________________________________________________ dense_3186 (Dense) (None, 1) 2 add_7218[0][0] add_7218[0][0] add_7218[0][0] ____________________________________________________________________________________________________ lambda_3968 (Lambda) (None, 1) 0 add_7218[0][0] dense_3174[11][0] ____________________________________________________________________________________________________ add_7080 (Add) (None, 1) 0 dense_3175[2][0] lambda_3889[0][0] ____________________________________________________________________________________________________ lambda_3896 (Lambda) (None, 1) 0 add_7088[0][0] dense_3174[1][0] ____________________________________________________________________________________________________ add_7187 (Add) (None, 1) 0 add_7174[0][0] multiply_4723[0][0] ____________________________________________________________________________________________________ multiply_4731 (Multiply) (None, 1) 0 multiply_4727[0][0] add_7199[0][0] ____________________________________________________________________________________________________ add_7212 (Add) (None, 1) 0 dense_3185[3][0] lambda_3963[0][0] ____________________________________________________________________________________________________ lambda_3970 (Lambda) (None, 1) 0 add_7218[0][0] dense_3174[11][0] ____________________________________________________________________________________________________ add_7084 (Add) (None, 1) 0 dense_3175[4][0] lambda_3891[0][0] ____________________________________________________________________________________________________ lambda_3898 (Lambda) (None, 1) 0 add_7088[0][0] dense_3174[1][0] ____________________________________________________________________________________________________ add_7191 (Add) (None, 1) 0 add_7178[0][0] multiply_4725[0][0] ____________________________________________________________________________________________________ multiply_4733 (Multiply) (None, 1) 0 multiply_4727[0][0] add_7203[0][0] ____________________________________________________________________________________________________ add_7216 (Add) (None, 1) 0 dense_3185[5][0] lambda_3965[0][0] ____________________________________________________________________________________________________ lambda_3972 (Lambda) (None, 1) 0 add_7218[0][0] dense_3174[11][0] ____________________________________________________________________________________________________ input_1392 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4656 (Multiply) (None, 1) 0 multiply_4655[0][0] add_7076[0][0] ____________________________________________________________________________________________________ add_7089 (Add) (None, 1) 0 dense_3176[0][0] lambda_3894[0][0] ____________________________________________________________________________________________________ lambda_3901 (Lambda) (None, 1) 0 add_7101[0][0] dense_3174[2][0] ____________________________________________________________________________________________________ multiply_4798 (Multiply) (None, 1) 0 dense_3174[18][0] input_1434[0][0] ____________________________________________________________________________________________________ add_7196 (Add) (None, 1) 0 add_7183[0][0] multiply_4729[0][0] ____________________________________________________________________________________________________ multiply_4737 (Multiply) (None, 1) 0 multiply_4735[0][0] add_7208[0][0] ____________________________________________________________________________________________________ add_7221 (Add) (None, 1) 0 dense_3186[1][0] lambda_3968[0][0] ____________________________________________________________________________________________________ dense_3187 (Dense) (None, 1) 2 add_7231[0][0] add_7231[0][0] add_7231[0][0] ____________________________________________________________________________________________________ lambda_3975 (Lambda) (None, 1) 0 add_7231[0][0] dense_3174[12][0] ____________________________________________________________________________________________________ input_1394 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4658 (Multiply) (None, 1) 0 multiply_4655[0][0] add_7080[0][0] ____________________________________________________________________________________________________ add_7093 (Add) (None, 1) 0 dense_3176[2][0] lambda_3896[0][0] ____________________________________________________________________________________________________ lambda_3903 (Lambda) (None, 1) 0 add_7101[0][0] dense_3174[2][0] ____________________________________________________________________________________________________ add_7200 (Add) (None, 1) 0 add_7187[0][0] multiply_4731[0][0] ____________________________________________________________________________________________________ multiply_4739 (Multiply) (None, 1) 0 multiply_4735[0][0] add_7212[0][0] ____________________________________________________________________________________________________ add_7225 (Add) (None, 1) 0 dense_3186[3][0] lambda_3970[0][0] ____________________________________________________________________________________________________ lambda_3977 (Lambda) (None, 1) 0 add_7231[0][0] dense_3174[12][0] ____________________________________________________________________________________________________ input_1396 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ multiply_4660 (Multiply) (None, 1) 0 multiply_4655[0][0] add_7084[0][0] ____________________________________________________________________________________________________ add_7097 (Add) (None, 1) 0 dense_3176[4][0] lambda_3898[0][0] ____________________________________________________________________________________________________ lambda_3905 (Lambda) (None, 1) 0 add_7101[0][0] dense_3174[2][0] ____________________________________________________________________________________________________ add_7204 (Add) (None, 1) 0 add_7191[0][0] multiply_4733[0][0] ____________________________________________________________________________________________________ multiply_4741 (Multiply) (None, 1) 0 multiply_4735[0][0] add_7216[0][0] ____________________________________________________________________________________________________ add_7229 (Add) (None, 1) 0 dense_3186[5][0] lambda_3972[0][0] ____________________________________________________________________________________________________ lambda_3979 (Lambda) (None, 1) 0 add_7231[0][0] dense_3174[12][0] ____________________________________________________________________________________________________ add_7077 (Add) (None, 1) 0 input_1392[0][0] multiply_4656[0][0] ____________________________________________________________________________________________________ multiply_4664 (Multiply) (None, 1) 0 multiply_4663[0][0] add_7089[0][0] ____________________________________________________________________________________________________ add_7102 (Add) (None, 1) 0 dense_3177[0][0] lambda_3901[0][0] ____________________________________________________________________________________________________ lambda_3908 (Lambda) (None, 1) 0 add_7114[0][0] dense_3174[3][0] ____________________________________________________________________________________________________ lambda_4015 (Lambda) (None, 1) 0 multiply_4798[0][0] ____________________________________________________________________________________________________ input_1435 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ add_7209 (Add) (None, 1) 0 add_7196[0][0] multiply_4737[0][0] ____________________________________________________________________________________________________ multiply_4745 (Multiply) (None, 1) 0 multiply_4743[0][0] add_7221[0][0] ____________________________________________________________________________________________________ add_7234 (Add) (None, 1) 0 dense_3187[1][0] lambda_3975[0][0] ____________________________________________________________________________________________________ dense_3188 (Dense) (None, 1) 2 add_7244[0][0] add_7244[0][0] add_7244[0][0] ____________________________________________________________________________________________________ lambda_3982 (Lambda) (None, 1) 0 add_7244[0][0] dense_3174[13][0] ____________________________________________________________________________________________________ add_7081 (Add) (None, 1) 0 input_1394[0][0] multiply_4658[0][0] ____________________________________________________________________________________________________ multiply_4666 (Multiply) (None, 1) 0 multiply_4663[0][0] add_7093[0][0] ____________________________________________________________________________________________________ add_7106 (Add) (None, 1) 0 dense_3177[2][0] lambda_3903[0][0] ____________________________________________________________________________________________________ lambda_3910 (Lambda) (None, 1) 0 add_7114[0][0] dense_3174[3][0] ____________________________________________________________________________________________________ add_7213 (Add) (None, 1) 0 add_7200[0][0] multiply_4739[0][0] ____________________________________________________________________________________________________ multiply_4747 (Multiply) (None, 1) 0 multiply_4743[0][0] add_7225[0][0] ____________________________________________________________________________________________________ add_7238 (Add) (None, 1) 0 dense_3187[3][0] lambda_3977[0][0] ____________________________________________________________________________________________________ lambda_3984 (Lambda) (None, 1) 0 add_7244[0][0] dense_3174[13][0] ____________________________________________________________________________________________________ add_7085 (Add) (None, 1) 0 input_1396[0][0] multiply_4660[0][0] ____________________________________________________________________________________________________ multiply_4668 (Multiply) (None, 1) 0 multiply_4663[0][0] add_7097[0][0] ____________________________________________________________________________________________________ add_7110 (Add) (None, 1) 0 dense_3177[4][0] lambda_3905[0][0] ____________________________________________________________________________________________________ lambda_3912 (Lambda) (None, 1) 0 add_7114[0][0] dense_3174[3][0] ____________________________________________________________________________________________________ add_7217 (Add) (None, 1) 0 add_7204[0][0] multiply_4741[0][0] ____________________________________________________________________________________________________ multiply_4749 (Multiply) (None, 1) 0 multiply_4743[0][0] add_7229[0][0] ____________________________________________________________________________________________________ add_7242 (Add) (None, 1) 0 dense_3187[5][0] lambda_3979[0][0] ____________________________________________________________________________________________________ lambda_3986 (Lambda) (None, 1) 0 add_7244[0][0] dense_3174[13][0] ____________________________________________________________________________________________________ add_7090 (Add) (None, 1) 0 add_7077[0][0] multiply_4664[0][0] ____________________________________________________________________________________________________ multiply_4672 (Multiply) (None, 1) 0 multiply_4671[0][0] add_7102[0][0] ____________________________________________________________________________________________________ add_7115 (Add) (None, 1) 0 dense_3178[0][0] lambda_3908[0][0] ____________________________________________________________________________________________________ lambda_3915 (Lambda) (None, 1) 0 add_7127[0][0] dense_3174[4][0] ____________________________________________________________________________________________________ multiply_4799 (Multiply) (None, 1) 0 lambda_4015[0][0] input_1435[0][0] ____________________________________________________________________________________________________ add_7222 (Add) (None, 1) 0 add_7209[0][0] multiply_4745[0][0] ____________________________________________________________________________________________________ multiply_4753 (Multiply) (None, 1) 0 multiply_4751[0][0] add_7234[0][0] ____________________________________________________________________________________________________ add_7247 (Add) (None, 1) 0 dense_3188[1][0] lambda_3982[0][0] ____________________________________________________________________________________________________ dense_3189 (Dense) (None, 1) 2 add_7257[0][0] add_7257[0][0] add_7257[0][0] ____________________________________________________________________________________________________ lambda_3989 (Lambda) (None, 1) 0 add_7257[0][0] dense_3174[14][0] ____________________________________________________________________________________________________ add_7094 (Add) (None, 1) 0 add_7081[0][0] multiply_4666[0][0] ____________________________________________________________________________________________________ multiply_4674 (Multiply) (None, 1) 0 multiply_4671[0][0] add_7106[0][0] ____________________________________________________________________________________________________ add_7119 (Add) (None, 1) 0 dense_3178[2][0] lambda_3910[0][0] ____________________________________________________________________________________________________ lambda_3917 (Lambda) (None, 1) 0 add_7127[0][0] dense_3174[4][0] ____________________________________________________________________________________________________ add_7226 (Add) (None, 1) 0 add_7213[0][0] multiply_4747[0][0] ____________________________________________________________________________________________________ multiply_4755 (Multiply) (None, 1) 0 multiply_4751[0][0] add_7238[0][0] ____________________________________________________________________________________________________ add_7251 (Add) (None, 1) 0 dense_3188[3][0] lambda_3984[0][0] ____________________________________________________________________________________________________ lambda_3991 (Lambda) (None, 1) 0 add_7257[0][0] dense_3174[14][0] ____________________________________________________________________________________________________ add_7098 (Add) (None, 1) 0 add_7085[0][0] multiply_4668[0][0] ____________________________________________________________________________________________________ multiply_4676 (Multiply) (None, 1) 0 multiply_4671[0][0] add_7110[0][0] ____________________________________________________________________________________________________ add_7123 (Add) (None, 1) 0 dense_3178[4][0] lambda_3912[0][0] ____________________________________________________________________________________________________ lambda_3919 (Lambda) (None, 1) 0 add_7127[0][0] dense_3174[4][0] ____________________________________________________________________________________________________ add_7230 (Add) (None, 1) 0 add_7217[0][0] multiply_4749[0][0] ____________________________________________________________________________________________________ multiply_4757 (Multiply) (None, 1) 0 multiply_4751[0][0] add_7242[0][0] ____________________________________________________________________________________________________ add_7255 (Add) (None, 1) 0 dense_3188[5][0] lambda_3986[0][0] ____________________________________________________________________________________________________ lambda_3993 (Lambda) (None, 1) 0 add_7257[0][0] dense_3174[14][0] ____________________________________________________________________________________________________ add_7103 (Add) (None, 1) 0 add_7090[0][0] multiply_4672[0][0] ____________________________________________________________________________________________________ multiply_4680 (Multiply) (None, 1) 0 multiply_4679[0][0] add_7115[0][0] ____________________________________________________________________________________________________ add_7128 (Add) (None, 1) 0 dense_3179[0][0] lambda_3915[0][0] ____________________________________________________________________________________________________ lambda_3922 (Lambda) (None, 1) 0 add_7140[0][0] dense_3174[5][0] ____________________________________________________________________________________________________ add_7322 (Add) (None, 1) 0 add_7309[0][0] multiply_4799[0][0] ____________________________________________________________________________________________________ add_7235 (Add) (None, 1) 0 add_7222[0][0] multiply_4753[0][0] ____________________________________________________________________________________________________ multiply_4761 (Multiply) (None, 1) 0 multiply_4759[0][0] add_7247[0][0] ____________________________________________________________________________________________________ add_7260 (Add) (None, 1) 0 dense_3189[1][0] lambda_3989[0][0] ____________________________________________________________________________________________________ dense_3190 (Dense) (None, 1) 2 add_7270[0][0] add_7270[0][0] add_7270[0][0] ____________________________________________________________________________________________________ lambda_3996 (Lambda) (None, 1) 0 add_7270[0][0] dense_3174[15][0] ____________________________________________________________________________________________________ add_7107 (Add) (None, 1) 0 add_7094[0][0] multiply_4674[0][0] ____________________________________________________________________________________________________ multiply_4682 (Multiply) (None, 1) 0 multiply_4679[0][0] add_7119[0][0] ____________________________________________________________________________________________________ add_7132 (Add) (None, 1) 0 dense_3179[2][0] lambda_3917[0][0] ____________________________________________________________________________________________________ lambda_3924 (Lambda) (None, 1) 0 add_7140[0][0] dense_3174[5][0] ____________________________________________________________________________________________________ add_7239 (Add) (None, 1) 0 add_7226[0][0] multiply_4755[0][0] ____________________________________________________________________________________________________ multiply_4763 (Multiply) (None, 1) 0 multiply_4759[0][0] add_7251[0][0] ____________________________________________________________________________________________________ add_7264 (Add) (None, 1) 0 dense_3189[3][0] lambda_3991[0][0] ____________________________________________________________________________________________________ lambda_3998 (Lambda) (None, 1) 0 add_7270[0][0] dense_3174[15][0] ____________________________________________________________________________________________________ add_7111 (Add) (None, 1) 0 add_7098[0][0] multiply_4676[0][0] ____________________________________________________________________________________________________ multiply_4684 (Multiply) (None, 1) 0 multiply_4679[0][0] add_7123[0][0] ____________________________________________________________________________________________________ add_7136 (Add) (None, 1) 0 dense_3179[4][0] lambda_3919[0][0] ____________________________________________________________________________________________________ lambda_3926 (Lambda) (None, 1) 0 add_7140[0][0] dense_3174[5][0] ____________________________________________________________________________________________________ add_7243 (Add) (None, 1) 0 add_7230[0][0] multiply_4757[0][0] ____________________________________________________________________________________________________ multiply_4765 (Multiply) (None, 1) 0 multiply_4759[0][0] add_7255[0][0] ____________________________________________________________________________________________________ add_7268 (Add) (None, 1) 0 dense_3189[5][0] lambda_3993[0][0] ____________________________________________________________________________________________________ lambda_4000 (Lambda) (None, 1) 0 add_7270[0][0] dense_3174[15][0] ____________________________________________________________________________________________________ add_7116 (Add) (None, 1) 0 add_7103[0][0] multiply_4680[0][0] ____________________________________________________________________________________________________ multiply_4688 (Multiply) (None, 1) 0 multiply_4687[0][0] add_7128[0][0] ____________________________________________________________________________________________________ add_7141 (Add) (None, 1) 0 dense_3180[0][0] lambda_3922[0][0] ____________________________________________________________________________________________________ lambda_3929 (Lambda) (None, 1) 0 add_7153[0][0] dense_3174[6][0] ____________________________________________________________________________________________________ add_7248 (Add) (None, 1) 0 add_7235[0][0] multiply_4761[0][0] ____________________________________________________________________________________________________ multiply_4769 (Multiply) (None, 1) 0 multiply_4767[0][0] add_7260[0][0] ____________________________________________________________________________________________________ add_7273 (Add) (None, 1) 0 dense_3190[1][0] lambda_3996[0][0] ____________________________________________________________________________________________________ dense_3191 (Dense) (None, 1) 2 add_7283[0][0] add_7283[0][0] add_7283[0][0] ____________________________________________________________________________________________________ lambda_4003 (Lambda) (None, 1) 0 add_7283[0][0] dense_3174[16][0] ____________________________________________________________________________________________________ add_7120 (Add) (None, 1) 0 add_7107[0][0] multiply_4682[0][0] ____________________________________________________________________________________________________ multiply_4690 (Multiply) (None, 1) 0 multiply_4687[0][0] add_7132[0][0] ____________________________________________________________________________________________________ add_7145 (Add) (None, 1) 0 dense_3180[2][0] lambda_3924[0][0] ____________________________________________________________________________________________________ lambda_3931 (Lambda) (None, 1) 0 add_7153[0][0] dense_3174[6][0] ____________________________________________________________________________________________________ add_7252 (Add) (None, 1) 0 add_7239[0][0] multiply_4763[0][0] ____________________________________________________________________________________________________ multiply_4771 (Multiply) (None, 1) 0 multiply_4767[0][0] add_7264[0][0] ____________________________________________________________________________________________________ add_7277 (Add) (None, 1) 0 dense_3190[3][0] lambda_3998[0][0] ____________________________________________________________________________________________________ lambda_4005 (Lambda) (None, 1) 0 add_7283[0][0] dense_3174[16][0] ____________________________________________________________________________________________________ add_7124 (Add) (None, 1) 0 add_7111[0][0] multiply_4684[0][0] ____________________________________________________________________________________________________ multiply_4692 (Multiply) (None, 1) 0 multiply_4687[0][0] add_7136[0][0] ____________________________________________________________________________________________________ add_7149 (Add) (None, 1) 0 dense_3180[4][0] lambda_3926[0][0] ____________________________________________________________________________________________________ lambda_3933 (Lambda) (None, 1) 0 add_7153[0][0] dense_3174[6][0] ____________________________________________________________________________________________________ add_7256 (Add) (None, 1) 0 add_7243[0][0] multiply_4765[0][0] ____________________________________________________________________________________________________ multiply_4773 (Multiply) (None, 1) 0 multiply_4767[0][0] add_7268[0][0] ____________________________________________________________________________________________________ add_7281 (Add) (None, 1) 0 dense_3190[5][0] lambda_4000[0][0] ____________________________________________________________________________________________________ lambda_4007 (Lambda) (None, 1) 0 add_7283[0][0] dense_3174[16][0] ____________________________________________________________________________________________________ add_7129 (Add) (None, 1) 0 add_7116[0][0] multiply_4688[0][0] ____________________________________________________________________________________________________ multiply_4696 (Multiply) (None, 1) 0 multiply_4695[0][0] add_7141[0][0] ____________________________________________________________________________________________________ add_7154 (Add) (None, 1) 0 dense_3181[0][0] lambda_3929[0][0] ____________________________________________________________________________________________________ lambda_3936 (Lambda) (None, 1) 0 add_7166[0][0] dense_3174[7][0] ____________________________________________________________________________________________________ add_7261 (Add) (None, 1) 0 add_7248[0][0] multiply_4769[0][0] ____________________________________________________________________________________________________ multiply_4777 (Multiply) (None, 1) 0 multiply_4775[0][0] add_7273[0][0] ____________________________________________________________________________________________________ add_7286 (Add) (None, 1) 0 dense_3191[1][0] lambda_4003[0][0] ____________________________________________________________________________________________________ dense_3192 (Dense) (None, 1) 2 add_7296[0][0] add_7296[0][0] add_7296[0][0] ____________________________________________________________________________________________________ lambda_4010 (Lambda) (None, 1) 0 add_7296[0][0] dense_3174[17][0] ____________________________________________________________________________________________________ input_1436 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ add_7133 (Add) (None, 1) 0 add_7120[0][0] multiply_4690[0][0] ____________________________________________________________________________________________________ multiply_4698 (Multiply) (None, 1) 0 multiply_4695[0][0] add_7145[0][0] ____________________________________________________________________________________________________ add_7158 (Add) (None, 1) 0 dense_3181[2][0] lambda_3931[0][0] ____________________________________________________________________________________________________ lambda_3938 (Lambda) (None, 1) 0 add_7166[0][0] dense_3174[7][0] ____________________________________________________________________________________________________ add_7265 (Add) (None, 1) 0 add_7252[0][0] multiply_4771[0][0] ____________________________________________________________________________________________________ multiply_4779 (Multiply) (None, 1) 0 multiply_4775[0][0] add_7277[0][0] ____________________________________________________________________________________________________ add_7290 (Add) (None, 1) 0 dense_3191[3][0] lambda_4005[0][0] ____________________________________________________________________________________________________ lambda_4012 (Lambda) (None, 1) 0 add_7296[0][0] dense_3174[17][0] ____________________________________________________________________________________________________ add_7137 (Add) (None, 1) 0 add_7124[0][0] multiply_4692[0][0] ____________________________________________________________________________________________________ multiply_4700 (Multiply) (None, 1) 0 multiply_4695[0][0] add_7149[0][0] ____________________________________________________________________________________________________ add_7162 (Add) (None, 1) 0 dense_3181[4][0] lambda_3933[0][0] ____________________________________________________________________________________________________ lambda_3940 (Lambda) (None, 1) 0 add_7166[0][0] dense_3174[7][0] ____________________________________________________________________________________________________ add_7269 (Add) (None, 1) 0 add_7256[0][0] multiply_4773[0][0] ____________________________________________________________________________________________________ multiply_4781 (Multiply) (None, 1) 0 multiply_4775[0][0] add_7281[0][0] ____________________________________________________________________________________________________ add_7294 (Add) (None, 1) 0 dense_3191[5][0] lambda_4007[0][0] ____________________________________________________________________________________________________ lambda_4014 (Lambda) (None, 1) 0 add_7296[0][0] dense_3174[17][0] ____________________________________________________________________________________________________ add_7142 (Add) (None, 1) 0 add_7129[0][0] multiply_4696[0][0] ____________________________________________________________________________________________________ multiply_4704 (Multiply) (None, 1) 0 multiply_4703[0][0] add_7154[0][0] ____________________________________________________________________________________________________ add_7167 (Add) (None, 1) 0 dense_3182[0][0] lambda_3936[0][0] ____________________________________________________________________________________________________ lambda_3943 (Lambda) (None, 1) 0 add_7179[0][0] dense_3174[8][0] ____________________________________________________________________________________________________ add_7274 (Add) (None, 1) 0 add_7261[0][0] multiply_4777[0][0] ____________________________________________________________________________________________________ multiply_4785 (Multiply) (None, 1) 0 multiply_4783[0][0] add_7286[0][0] ____________________________________________________________________________________________________ add_7299 (Add) (None, 1) 0 dense_3192[1][0] lambda_4010[0][0] ____________________________________________________________________________________________________ dense_3193 (Dense) (None, 1) 2 add_7309[0][0] add_7309[0][0] add_7309[0][0] ____________________________________________________________________________________________________ lambda_4017 (Lambda) (None, 1) 0 add_7309[0][0] dense_3174[18][0] ____________________________________________________________________________________________________ multiply_4806 (Multiply) (None, 1) 0 dense_3174[19][0] input_1436[0][0] ____________________________________________________________________________________________________ add_7146 (Add) (None, 1) 0 add_7133[0][0] multiply_4698[0][0] ____________________________________________________________________________________________________ multiply_4706 (Multiply) (None, 1) 0 multiply_4703[0][0] add_7158[0][0] ____________________________________________________________________________________________________ add_7171 (Add) (None, 1) 0 dense_3182[2][0] lambda_3938[0][0] ____________________________________________________________________________________________________ lambda_3945 (Lambda) (None, 1) 0 add_7179[0][0] dense_3174[8][0] ____________________________________________________________________________________________________ add_7278 (Add) (None, 1) 0 add_7265[0][0] multiply_4779[0][0] ____________________________________________________________________________________________________ multiply_4787 (Multiply) (None, 1) 0 multiply_4783[0][0] add_7290[0][0] ____________________________________________________________________________________________________ add_7303 (Add) (None, 1) 0 dense_3192[3][0] lambda_4012[0][0] ____________________________________________________________________________________________________ lambda_4019 (Lambda) (None, 1) 0 add_7309[0][0] dense_3174[18][0] ____________________________________________________________________________________________________ add_7150 (Add) (None, 1) 0 add_7137[0][0] multiply_4700[0][0] ____________________________________________________________________________________________________ multiply_4708 (Multiply) (None, 1) 0 multiply_4703[0][0] add_7162[0][0] ____________________________________________________________________________________________________ add_7175 (Add) (None, 1) 0 dense_3182[4][0] lambda_3940[0][0] ____________________________________________________________________________________________________ lambda_3947 (Lambda) (None, 1) 0 add_7179[0][0] dense_3174[8][0] ____________________________________________________________________________________________________ add_7282 (Add) (None, 1) 0 add_7269[0][0] multiply_4781[0][0] ____________________________________________________________________________________________________ multiply_4789 (Multiply) (None, 1) 0 multiply_4783[0][0] add_7294[0][0] ____________________________________________________________________________________________________ add_7307 (Add) (None, 1) 0 dense_3192[5][0] lambda_4014[0][0] ____________________________________________________________________________________________________ lambda_4021 (Lambda) (None, 1) 0 add_7309[0][0] dense_3174[18][0] ____________________________________________________________________________________________________ add_7155 (Add) (None, 1) 0 add_7142[0][0] multiply_4704[0][0] ____________________________________________________________________________________________________ multiply_4712 (Multiply) (None, 1) 0 multiply_4711[0][0] add_7167[0][0] ____________________________________________________________________________________________________ add_7180 (Add) (None, 1) 0 dense_3183[0][0] lambda_3943[0][0] ____________________________________________________________________________________________________ lambda_3950 (Lambda) (None, 1) 0 add_7192[0][0] dense_3174[9][0] ____________________________________________________________________________________________________ add_7287 (Add) (None, 1) 0 add_7274[0][0] multiply_4785[0][0] ____________________________________________________________________________________________________ multiply_4793 (Multiply) (None, 1) 0 multiply_4791[0][0] add_7299[0][0] ____________________________________________________________________________________________________ add_7312 (Add) (None, 1) 0 dense_3193[1][0] lambda_4017[0][0] ____________________________________________________________________________________________________ lambda_4022 (Lambda) (None, 1) 0 multiply_4806[0][0] ____________________________________________________________________________________________________ input_1437 (InputLayer) (None, 1) 0 ____________________________________________________________________________________________________ dense_3194 (Dense) (None, 1) 2 add_7322[0][0] add_7322[0][0] add_7322[0][0] ____________________________________________________________________________________________________ lambda_4024 (Lambda) (None, 1) 0 add_7322[0][0] dense_3174[19][0] ____________________________________________________________________________________________________ add_7159 (Add) (None, 1) 0 add_7146[0][0] multiply_4706[0][0] ____________________________________________________________________________________________________ multiply_4714 (Multiply) (None, 1) 0 multiply_4711[0][0] add_7171[0][0] ____________________________________________________________________________________________________ add_7184 (Add) (None, 1) 0 dense_3183[2][0] lambda_3945[0][0] ____________________________________________________________________________________________________ lambda_3953 (Lambda) (None, 1) 0 add_7192[0][0] dense_3174[9][0] ____________________________________________________________________________________________________ add_7291 (Add) (None, 1) 0 add_7278[0][0] multiply_4787[0][0] ____________________________________________________________________________________________________ multiply_4795 (Multiply) (None, 1) 0 multiply_4791[0][0] add_7303[0][0] ____________________________________________________________________________________________________ add_7316 (Add) (None, 1) 0 dense_3193[3][0] lambda_4019[0][0] ____________________________________________________________________________________________________ lambda_4027 (Lambda) (None, 1) 0 add_7322[0][0] dense_3174[19][0] ____________________________________________________________________________________________________ add_7163 (Add) (None, 1) 0 add_7150[0][0] multiply_4708[0][0] ____________________________________________________________________________________________________ multiply_4716 (Multiply) (None, 1) 0 multiply_4711[0][0] add_7175[0][0] ____________________________________________________________________________________________________ add_7188 (Add) (None, 1) 0 dense_3183[4][0] lambda_3947[0][0] ____________________________________________________________________________________________________ lambda_3956 (Lambda) (None, 1) 0 add_7192[0][0] dense_3174[9][0] ____________________________________________________________________________________________________ add_7295 (Add) (None, 1) 0 add_7282[0][0] multiply_4789[0][0] ____________________________________________________________________________________________________ multiply_4797 (Multiply) (None, 1) 0 multiply_4791[0][0] add_7307[0][0] ____________________________________________________________________________________________________ add_7320 (Add) (None, 1) 0 dense_3193[5][0] lambda_4021[0][0] ____________________________________________________________________________________________________ lambda_4030 (Lambda) (None, 1) 0 add_7322[0][0] dense_3174[19][0] ____________________________________________________________________________________________________ add_7168 (Add) (None, 1) 0 add_7155[0][0] multiply_4712[0][0] ____________________________________________________________________________________________________ multiply_4720 (Multiply) (None, 1) 0 multiply_4719[0][0] add_7180[0][0] ____________________________________________________________________________________________________ add_7193 (Add) (None, 1) 0 dense_3184[0][0] lambda_3950[0][0] ____________________________________________________________________________________________________ add_7300 (Add) (None, 1) 0 add_7287[0][0] multiply_4793[0][0] ____________________________________________________________________________________________________ multiply_4801 (Multiply) (None, 1) 0 multiply_4799[0][0] add_7312[0][0] ____________________________________________________________________________________________________ multiply_4807 (Multiply) (None, 1) 0 lambda_4022[0][0] input_1437[0][0] ____________________________________________________________________________________________________ add_7325 (Add) (None, 1) 0 dense_3194[1][0] lambda_4024[0][0] ____________________________________________________________________________________________________ add_7172 (Add) (None, 1) 0 add_7159[0][0] multiply_4714[0][0] ____________________________________________________________________________________________________ multiply_4722 (Multiply) (None, 1) 0 multiply_4719[0][0] add_7184[0][0] ____________________________________________________________________________________________________ add_7197 (Add) (None, 1) 0 dense_3184[2][0] lambda_3953[0][0] ____________________________________________________________________________________________________ add_7304 (Add) (None, 1) 0 add_7291[0][0] multiply_4795[0][0] ____________________________________________________________________________________________________ multiply_4803 (Multiply) (None, 1) 0 multiply_4799[0][0] add_7316[0][0] ____________________________________________________________________________________________________ add_7329 (Add) (None, 1) 0 dense_3194[3][0] lambda_4027[0][0] ____________________________________________________________________________________________________ add_7176 (Add) (None, 1) 0 add_7163[0][0] multiply_4716[0][0] ____________________________________________________________________________________________________ multiply_4724 (Multiply) (None, 1) 0 multiply_4719[0][0] add_7188[0][0] ____________________________________________________________________________________________________ add_7201 (Add) (None, 1) 0 dense_3184[4][0] lambda_3956[0][0] ____________________________________________________________________________________________________ add_7308 (Add) (None, 1) 0 add_7295[0][0] multiply_4797[0][0] ____________________________________________________________________________________________________ multiply_4805 (Multiply) (None, 1) 0 multiply_4799[0][0] add_7320[0][0] ____________________________________________________________________________________________________ add_7333 (Add) (None, 1) 0 dense_3194[5][0] lambda_4030[0][0] ____________________________________________________________________________________________________ add_7181 (Add) (None, 1) 0 add_7168[0][0] multiply_4720[0][0] ____________________________________________________________________________________________________ multiply_4728 (Multiply) (None, 1) 0 multiply_4727[0][0] add_7193[0][0] ____________________________________________________________________________________________________ add_7313 (Add) (None, 1) 0 add_7300[0][0] multiply_4801[0][0] ____________________________________________________________________________________________________ multiply_4809 (Multiply) (None, 1) 0 multiply_4807[0][0] add_7325[0][0] ____________________________________________________________________________________________________ add_7185 (Add) (None, 1) 0 add_7172[0][0] multiply_4722[0][0] ____________________________________________________________________________________________________ multiply_4730 (Multiply) (None, 1) 0 multiply_4727[0][0] add_7197[0][0] ____________________________________________________________________________________________________ add_7317 (Add) (None, 1) 0 add_7304[0][0] multiply_4803[0][0] ____________________________________________________________________________________________________ multiply_4811 (Multiply) (None, 1) 0 multiply_4807[0][0] add_7329[0][0] ____________________________________________________________________________________________________ add_7189 (Add) (None, 1) 0 add_7176[0][0] multiply_4724[0][0] ____________________________________________________________________________________________________ multiply_4732 (Multiply) (None, 1) 0 multiply_4727[0][0] add_7201[0][0] ____________________________________________________________________________________________________ add_7321 (Add) (None, 1) 0 add_7308[0][0] multiply_4805[0][0] ____________________________________________________________________________________________________ multiply_4813 (Multiply) (None, 1) 0 multiply_4807[0][0] add_7333[0][0] ____________________________________________________________________________________________________ lambda_3951 (Lambda) (None, 1) 0 add_7192[0][0] ____________________________________________________________________________________________________ add_7194 (Add) (None, 1) 0 add_7181[0][0] multiply_4728[0][0] ____________________________________________________________________________________________________ lambda_4025 (Lambda) (None, 1) 0 add_7322[0][0] ____________________________________________________________________________________________________ add_7326 (Add) (None, 1) 0 add_7313[0][0] multiply_4809[0][0] ____________________________________________________________________________________________________ lambda_3954 (Lambda) (None, 1) 0 add_7192[0][0] ____________________________________________________________________________________________________ add_7198 (Add) (None, 1) 0 add_7185[0][0] multiply_4730[0][0] ____________________________________________________________________________________________________ lambda_4028 (Lambda) (None, 1) 0 add_7322[0][0] ____________________________________________________________________________________________________ add_7330 (Add) (None, 1) 0 add_7317[0][0] multiply_4811[0][0] ____________________________________________________________________________________________________ lambda_3957 (Lambda) (None, 1) 0 add_7192[0][0] ____________________________________________________________________________________________________ add_7202 (Add) (None, 1) 0 add_7189[0][0] multiply_4732[0][0] ____________________________________________________________________________________________________ lambda_4031 (Lambda) (None, 1) 0 add_7322[0][0] ____________________________________________________________________________________________________ add_7334 (Add) (None, 1) 0 add_7321[0][0] multiply_4813[0][0] ____________________________________________________________________________________________________ subtract_175 (Subtract) (None, 1) 0 lambda_3951[0][0] add_7194[0][0] ____________________________________________________________________________________________________ subtract_178 (Subtract) (None, 1) 0 lambda_4025[0][0] add_7326[0][0] ____________________________________________________________________________________________________ subtract_176 (Subtract) (None, 1) 0 lambda_3954[0][0] add_7198[0][0] ____________________________________________________________________________________________________ subtract_179 (Subtract) (None, 1) 0 lambda_4028[0][0] add_7330[0][0] ____________________________________________________________________________________________________ subtract_177 (Subtract) (None, 1) 0 lambda_3957[0][0] add_7202[0][0] ____________________________________________________________________________________________________ subtract_180 (Subtract) (None, 1) 0 lambda_4031[0][0] add_7334[0][0] ____________________________________________________________________________________________________ concatenate_30 (Concatenate) (None, 6) 0 subtract_175[0][0] subtract_178[0][0] subtract_176[0][0] subtract_179[0][0] subtract_177[0][0] subtract_180[0][0] ==================================================================================================== Total params: 71 Trainable params: 31 Non-trainable params: 40 ____________________________________________________________________________________________________
Here we use a very small amount of training data just for purposes of illustration even though it works relatively well. Below we consecutively train hedges or local volatilities.
Ltrain = 10**4
xtrain =([np.ones(Ltrain)] + [np.zeros(Ltrain) for key in keylist]+
[np.random.normal(0,1,Ltrain) for i in range(N)]+
[np.ones(Ltrain) for i in range(N)])
ytrain=np.zeros((Ltrain,len(P.keys())))
for i in range(Ltrain):
for l in range(len(P.keys())):
key = keylist[l]
ytrain[i,l]= P[key]
In the sequel the actual training is performed:
import matplotlib.pyplot as plt
localvol_trainhedge.compile(optimizer='adam',
loss='mean_squared_error')
localvol_trainlocvol.compile(optimizer='adam',
loss='mean_squared_error')
for i in range(5):
localvol_trainhedge.fit(x=xtrain,y=ytrain, epochs=15,verbose=True)
x = localvol_trainhedge.get_weights()
localvol_trainlocvol.set_weights(x)
localvol_trainlocvol.fit(x=xtrain,y=ytrain, epochs=5,verbose=True)
plt.hist(localvol_trainhedge.predict(xtrain)[:,0])
plt.show()
print(np.mean(localvol_trainhedge.predict(xtrain)[:,0]))
y = localvol_trainlocvol.get_weights()
localvol_trainhedge.set_weights(y)
Epoch 1/15 10000/10000 [==============================] - 25s - loss: 0.1271 Epoch 2/15 10000/10000 [==============================] - 3s - loss: 0.1090 Epoch 3/15 10000/10000 [==============================] - 3s - loss: 0.0992 Epoch 4/15 10000/10000 [==============================] - 3s - loss: 0.0905 Epoch 5/15 10000/10000 [==============================] - 2s - loss: 0.0826 Epoch 6/15 10000/10000 [==============================] - 3s - loss: 0.0755 Epoch 7/15 10000/10000 [==============================] - 3s - loss: 0.0691 Epoch 8/15 10000/10000 [==============================] - 3s - loss: 0.0635 Epoch 9/15 10000/10000 [==============================] - 3s - loss: 0.0584 Epoch 10/15 10000/10000 [==============================] - 3s - loss: 0.0540 Epoch 11/15 10000/10000 [==============================] - 3s - loss: 0.0501 Epoch 12/15 10000/10000 [==============================] - 3s - loss: 0.0467 Epoch 13/15 10000/10000 [==============================] - 3s - loss: 0.0437 Epoch 14/15 10000/10000 [==============================] - 3s - loss: 0.0411 Epoch 15/15 10000/10000 [==============================] - 3s - loss: 0.0387 Epoch 1/5 10000/10000 [==============================] - 37s - loss: 0.0227 Epoch 2/5 10000/10000 [==============================] - 6s - loss: 0.0212 Epoch 3/5 10000/10000 [==============================] - 6s - loss: 0.0207 Epoch 4/5 10000/10000 [==============================] - 10s - loss: 0.0189 Epoch 5/5 10000/10000 [==============================] - 6s - loss: 0.0178
0.27073652 Epoch 1/15 10000/10000 [==============================] - 3s - loss: 0.0141 Epoch 2/15 10000/10000 [==============================] - 3s - loss: 0.0126 Epoch 3/15 10000/10000 [==============================] - 3s - loss: 0.0125 Epoch 4/15 10000/10000 [==============================] - 3s - loss: 0.0125 Epoch 5/15 10000/10000 [==============================] - 3s - loss: 0.0124 Epoch 6/15 10000/10000 [==============================] - 3s - loss: 0.0123 Epoch 7/15 10000/10000 [==============================] - 3s - loss: 0.0123 Epoch 8/15 10000/10000 [==============================] - 2s - loss: 0.0122 Epoch 9/15 10000/10000 [==============================] - 3s - loss: 0.0121 Epoch 10/15 10000/10000 [==============================] - 3s - loss: 0.0120 Epoch 11/15 10000/10000 [==============================] - 3s - loss: 0.0120 Epoch 12/15 10000/10000 [==============================] - 3s - loss: 0.0119 Epoch 13/15 10000/10000 [==============================] - 3s - loss: 0.0118 Epoch 14/15 10000/10000 [==============================] - 3s - loss: 0.0118 Epoch 15/15 10000/10000 [==============================] - 3s - loss: 0.0117 Epoch 1/5 10000/10000 [==============================] - 6s - loss: 0.0113 Epoch 2/5 10000/10000 [==============================] - 6s - loss: 0.0112 Epoch 3/5 10000/10000 [==============================] - 9s - loss: 0.0112 Epoch 4/5 10000/10000 [==============================] - 6s - loss: 0.0112 Epoch 5/5 10000/10000 [==============================] - 6s - loss: 0.0112
0.18796247 Epoch 1/15 10000/10000 [==============================] - 3s - loss: 0.0110 Epoch 2/15 10000/10000 [==============================] - 3s - loss: 0.0110 Epoch 3/15 10000/10000 [==============================] - 3s - loss: 0.0110 Epoch 4/15 10000/10000 [==============================] - 3s - loss: 0.0110 Epoch 5/15 10000/10000 [==============================] - 4s - loss: 0.0109 Epoch 6/15 10000/10000 [==============================] - 3s - loss: 0.0109 Epoch 7/15 10000/10000 [==============================] - 3s - loss: 0.0109 Epoch 8/15 10000/10000 [==============================] - 3s - loss: 0.0109 Epoch 9/15 10000/10000 [==============================] - 3s - loss: 0.0109 Epoch 10/15 10000/10000 [==============================] - 3s - loss: 0.0109 Epoch 11/15 10000/10000 [==============================] - 4s - loss: 0.0109 Epoch 12/15 10000/10000 [==============================] - 5s - loss: 0.0109 Epoch 13/15 10000/10000 [==============================] - 4s - loss: 0.0108 Epoch 14/15 10000/10000 [==============================] - 3s - loss: 0.0108 Epoch 15/15 10000/10000 [==============================] - 3s - loss: 0.0108 Epoch 1/5 10000/10000 [==============================] - 8s - loss: 0.0108 Epoch 2/5 10000/10000 [==============================] - 8s - loss: 0.0108 Epoch 3/5 10000/10000 [==============================] - 7s - loss: 0.0108 Epoch 4/5 10000/10000 [==============================] - 8s - loss: 0.0108 Epoch 5/5 10000/10000 [==============================] - 8s - loss: 0.0108
0.17364338 Epoch 1/15 10000/10000 [==============================] - 3s - loss: 0.0108 Epoch 2/15 10000/10000 [==============================] - 3s - loss: 0.0108 Epoch 3/15 10000/10000 [==============================] - 4s - loss: 0.0108 Epoch 4/15 10000/10000 [==============================] - 3s - loss: 0.0108 Epoch 5/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 6/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 7/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 8/15 10000/10000 [==============================] - 4s - loss: 0.0107 Epoch 9/15 10000/10000 [==============================] - 4s - loss: 0.0107 Epoch 10/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 11/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 12/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 13/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 14/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 15/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 1/5 10000/10000 [==============================] - 7s - loss: 0.0107 Epoch 2/5 10000/10000 [==============================] - 8s - loss: 0.0107 Epoch 3/5 10000/10000 [==============================] - 8s - loss: 0.0107 Epoch 4/5 10000/10000 [==============================] - 10s - loss: 0.0107 Epoch 5/5 10000/10000 [==============================] - 9s - loss: 0.0107
0.17294763 Epoch 1/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 2/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 3/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 4/15 10000/10000 [==============================] - 3s - loss: 0.0107 Epoch 5/15 10000/10000 [==============================] - 3s - loss: 0.0106 Epoch 6/15 10000/10000 [==============================] - 3s - loss: 0.0106 Epoch 7/15 10000/10000 [==============================] - 3s - loss: 0.0106 Epoch 8/15 10000/10000 [==============================] - 3s - loss: 0.0106 Epoch 9/15 10000/10000 [==============================] - 3s - loss: 0.0106 Epoch 10/15 10000/10000 [==============================] - 3s - loss: 0.0106 Epoch 11/15 10000/10000 [==============================] - 3s - loss: 0.0106 Epoch 12/15 10000/10000 [==============================] - 4s - loss: 0.0106 Epoch 13/15 10000/10000 [==============================] - 5s - loss: 0.0106 Epoch 14/15 10000/10000 [==============================] - 4s - loss: 0.0106 Epoch 15/15 10000/10000 [==============================] - 4s - loss: 0.0106 Epoch 1/5 10000/10000 [==============================] - 8s - loss: 0.0106 Epoch 2/5 10000/10000 [==============================] - 6s - loss: 0.0106 Epoch 3/5 10000/10000 [==============================] - 6s - loss: 0.0106 Epoch 4/5 10000/10000 [==============================] - 7s - loss: 0.0105 Epoch 5/5 10000/10000 [==============================] - 7s - loss: 0.0105
0.17700884
Hedging helps to reduce variance tremendously, whence we are able to go for a classical means square calibration approach, which is implemented below with a custom loss function.
def custom_loss(y_true,y_pred):
return K.mean((K.mean(y_pred,axis=0)-K.mean(y_true,axis=0))**2)
localvol_trainlocvol.compile(optimizer='adam',
loss=custom_loss)
for i in range(10):
localvol_trainlocvol.fit(x=xtrain,y=ytrain, epochs=5, verbose=True,batch_size=10**4)
plt.hist(localvol_trainlocvol.predict(xtrain)[:,:])
plt.show()
print(np.mean(localvol_trainlocvol.predict(xtrain)[:,:],axis=0))
Epoch 1/5 10000/10000 [==============================] - 0s - loss: 1.7071e-05 Epoch 2/5 10000/10000 [==============================] - 0s - loss: 1.4733e-05 Epoch 3/5 10000/10000 [==============================] - 0s - loss: 1.2625e-05 Epoch 4/5 10000/10000 [==============================] - 0s - loss: 1.0753e-05 Epoch 5/5 10000/10000 [==============================] - 0s - loss: 9.1196e-06
[0.19766045 0.2352989 0.15941346 0.2061147 0.12752648 0.17992648] Epoch 1/5 10000/10000 [==============================] - 0s - loss: 7.7151e-06 Epoch 2/5 10000/10000 [==============================] - 0s - loss: 6.5300e-06 Epoch 3/5 10000/10000 [==============================] - 0s - loss: 5.5497e-06 Epoch 4/5 10000/10000 [==============================] - 0s - loss: 4.7529e-06 Epoch 5/5 10000/10000 [==============================] - 0s - loss: 4.1238e-06
[0.19882971 0.23690218 0.16048893 0.20758782 0.12848227 0.18125945] Epoch 1/5 10000/10000 [==============================] - 0s - loss: 3.6407e-06 Epoch 2/5 10000/10000 [==============================] - 0s - loss: 3.2854e-06 Epoch 3/5 10000/10000 [==============================] - 0s - loss: 3.0373e-06 Epoch 4/5 10000/10000 [==============================] - 0s - loss: 2.8780e-06 Epoch 5/5 10000/10000 [==============================] - 0s - loss: 2.7919e-06
[0.1996602 0.23803909 0.16125116 0.20863296 0.12916146 0.18220441] Epoch 1/5 10000/10000 [==============================] - 0s - loss: 2.7618e-06 Epoch 2/5 10000/10000 [==============================] - 0s - loss: 2.7738e-06 Epoch 3/5 10000/10000 [==============================] - 0s - loss: 2.8156e-06 Epoch 4/5 10000/10000 [==============================] - 0s - loss: 2.8773e-06 Epoch 5/5 10000/10000 [==============================] - 0s - loss: 2.9517e-06
[0.20015445 0.23871522 0.16170453 0.20925388 0.12956533 0.18276557] Epoch 1/5 10000/10000 [==============================] - 0s - loss: 3.0291e-06 Epoch 2/5 10000/10000 [==============================] - 0s - loss: 3.1069e-06 Epoch 3/5 10000/10000 [==============================] - 0s - loss: 3.1767e-06 Epoch 4/5 10000/10000 [==============================] - 0s - loss: 3.2394e-06 Epoch 5/5 10000/10000 [==============================] - 0s - loss: 3.2908e-06
[0.20036927 0.2390097 0.16190232 0.20952344 0.12974094 0.18300998] Epoch 1/5 10000/10000 [==============================] - 0s - loss: 3.3301e-06 Epoch 2/5 10000/10000 [==============================] - 0s - loss: 3.3584e-06 Epoch 3/5 10000/10000 [==============================] - 0s - loss: 3.3730e-06 Epoch 4/5 10000/10000 [==============================] - 0s - loss: 3.3763e-06 Epoch 5/5 10000/10000 [==============================] - 0s - loss: 3.3702e-06
[0.20038432 0.23903024 0.16191632 0.20954241 0.12975426 0.18302672] Epoch 1/5 10000/10000 [==============================] - 0s - loss: 3.3543e-06 Epoch 2/5 10000/10000 [==============================] - 0s - loss: 3.3306e-06 Epoch 3/5 10000/10000 [==============================] - 0s - loss: 3.3006e-06 Epoch 4/5 10000/10000 [==============================] - 0s - loss: 3.2659e-06 Epoch 5/5 10000/10000 [==============================] - 0s - loss: 3.2274e-06
[0.2002782 0.23888339 0.16181938 0.20940886 0.1296677 0.1829058 ] Epoch 1/5 10000/10000 [==============================] - 0s - loss: 3.1874e-06 Epoch 2/5 10000/10000 [==============================] - 0s - loss: 3.1449e-06 Epoch 3/5 10000/10000 [==============================] - 0s - loss: 3.1034e-06 Epoch 4/5 10000/10000 [==============================] - 0s - loss: 3.0620e-06 Epoch 5/5 10000/10000 [==============================] - 0s - loss: 3.0222e-06
[0.20011768 0.23866326 0.16167204 0.20920657 0.12953676 0.18272291] Epoch 1/5 10000/10000 [==============================] - 0s - loss: 2.9854e-06 Epoch 2/5 10000/10000 [==============================] - 0s - loss: 2.9507e-06 Epoch 3/5 10000/10000 [==============================] - 0s - loss: 2.9188e-06 Epoch 4/5 10000/10000 [==============================] - 0s - loss: 2.8895e-06 Epoch 5/5 10000/10000 [==============================] - 0s - loss: 2.8636e-06
[0.19995114 0.23843387 0.16151938 0.20899665 0.12940088 0.18253349] Epoch 1/5 10000/10000 [==============================] - 0s - loss: 2.8419e-06 Epoch 2/5 10000/10000 [==============================] - 0s - loss: 2.8221e-06 Epoch 3/5 10000/10000 [==============================] - 0s - loss: 2.8059e-06 Epoch 4/5 10000/10000 [==============================] - 0s - loss: 2.7922e-06 Epoch 5/5 10000/10000 [==============================] - 0s - loss: 2.7806e-06
[0.19980825 0.23823719 0.16138901 0.20881638 0.12928516 0.18237126]
Ltest = 10**6
xtest =([np.ones(Ltest)] + [np.zeros(Ltest) for key in keylist]+
[np.random.normal(0,1,Ltest) for i in range(N)]+
[np.ones(Ltest) for i in range(N)])
ytest=np.zeros((Ltest,len(P.keys())))
for i in range(Ltest):
for l in range(len(P.keys())):
key = keylist[l]
ytest[i,l]= P[key]
plt.hist(localvol_trainlocvol.predict(xtest)[:,:])
plt.show()
print(np.mean(localvol_trainlocvol.predict(xtest)[:,:],axis=0))
[0.20017254 0.23855153 0.16223146 0.20956783 0.13054265 0.18354742]
P
{(0.9, 0.5): 0.20042534, (0.9, 1.0): 0.23559685, (1.0, 0.5): 0.16312157, (1.0, 1.0): 0.20771958, (1.1, 0.5): 0.13154241, (1.1, 1.0): 0.18236567}
... not so bad.