Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Assignment : keras code for a multilayer perceptron neural network To type in Jupyter notebook (ipynb file). In the following 4 questions the code should simply build the architecture of the model....

1 answer below »
Assignment : keras code for a multilayer perceptron neural network
To type in Jupyter notebook (ipynb file).
In the following 4 questions the code should simply build the architecture of the
model. You will not need to not run it on real data.
1. Write the keras code for a multilayer perceptron neural network with the following
structure: Three hidden layers. 50 hidden units in the first hidden layer, 100 in the
second, and 150 in the third. Activate all hidden layers with relu. The output layer
should be built to classify to five categories. Further, your optimization technique should
e stochastic gradient descent. (This code should simply build the architecture of the
model. You will not run it on real data.)
2. Write the keras code for a multilayer perceptron neural network with the following
structure: Two hidden layers. 75 hidden units in the first hidden layer and 150 in the
second. Activate all hidden layers with relu. The output layer should be built to classify
a binary dependent variable. Further, your optimization technique should be stochastic
gradient descent. (This code should simply build the architecture of the model. You will
not run it on real data.)
3. Write the keras code for a convolutional neural network with the following structure:
Two convolutional layers. 16 filters in the first layer and 28 in the second. Activate all
convolutional layers with relu. Use max pooling after each convolutional layer with a 2
y 2 filter. The output layer should be built to classify to ten categories. Further, your
optimization technique should be stochastic gradient descent. (This code should simply
uild the architecture of the model. You will not run it on real data.)
4. Write the keras code for a convolutional neural network with the following structure:
Two convolutional layers. 32 filters in the first layer and 32 in the second. Activate all
convolutional layers with relu. Use max pooling after each convolutional layer with a 2
y 2 filter. Add two fully connected layers with 128 hidden units in each layer and relu
activations. The output layer should be built to classify to six categories. Further, your
optimization technique should be stochastic gradient descent. (This code should simply
uild the architecture of the model. You will not run it on real data.)
Answered 2 days After Apr 18, 2021

Solution

Sandeep Kumar answered on Apr 21 2021
168 Votes
{
"metadata": {
"language_info": {
"codemi
or_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python3",
"display_name": "Python 3",
"language": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"source": [
"Part 1"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"from keras.models import Sequential\n",
"from keras.layers import Dense, Conv2D, MaxPooling2D, Activation, Flatten\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
"model = Sequential()\n",
"model.add(Dense(50,input_dim=8,activation='relu'))\n",
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here