Consider the code below num_epochs = 500 batch = 100 # Const…

Consider the code below num_epochs = 500 batch = 100 # Construct hidden layers inputs = tf.keras.layers.Dense(units=16, activation=’relu’, input_shape=]) hidden = tf.keras.layers.Dense(units=16, activation=’relu’) outputs = tf.keras.layers.Dense(units=1) # Stack the layers model = tf.keras.Sequential() # Loss function and optimizer(with learning rate) loss = ‘mse’ optimizer = tf.keras.optimizers.Adam(0.001) # Compile the model model.compile(loss=loss, optimizer=optimizer, metrics=) # Train the model history = model.fit(x_train_normalized, y_train_normalized, epochs=num_epochs, batch_size=batch, validation_split=0.1, verbose=0)After running the code above, how do you pick the new number of epochs to train your model one last time in the whole dataset?

Consider an economy with three possible states: bad, normal,…

Consider an economy with three possible states: bad, normal, and good. The probability of each state is given in the array of probabilities “p”  below. The payoff of a risky stock in each state is given in the array R.  p = np.array() R = np.array(, , ]) If we want to compute the expected return on this risky asset, what is the command line we should execute in Python?

Consider the code below with numbered lines:1)def h(x): 2) r…

Consider the code below with numbered lines:1)def h(x): 2) return np.exp(-x**2 / 2) / np.sqrt(2 * np.pi) 3) 4)x = np.linspace(-4, 4, 51) 5)y = np.zeros_like(x) 6) 7)for i in range(len(y)-1): 8) y = h(x) 9)plt.plot(x, y) If we run the code above, we will receive an error. In which line lies the error?