Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 2 ( 6 Points ) : Train the model on the training data with batch _ size = 1 2 8 and epochs =

Problem 2(6 Points):
Train the model on the training data with batch_size=128 and epochs=2 then return the trained model along with the training accuracy .
HINT 1: To calculate the training accuracy use evaluate function with trainning data.
HINT 2: Train the model with validation_data=(testing_data)Train the model on the training data with batch_size=128 and epochs=2 then return the trained model along with the training accuracy . Problem 2(6 Points):
Train the model on the training data with batch_size=128 and epochs=2 then return the trained model along with the training accuracy .
HINT 1: To calculate the training accuracy use evaluate function with trainning data.
HINT 2: Train the model with validation_data=(testing_data)
HINT 1: To calculate the training accuracy use evaluate function with trainning data.
HINT 2: Train the model with validation_data=(testing_data) # Function 2: Train the model
def train_model(model, x_train, y_train, x_test, y_test):
'''
input:
model: a compiled CNN model with input of size (28,28,1) and output of size 10
x_train: an array of training dataset
y_train: an array of the labels for the inputs in array x_train
x_test: an array of validation dataset. This validation dataset is used during the training of the model
y_test: an array of the labels for the validation dataset in x_test
output:
t_model: a trained verision of the input model that is trained using the given train dataset
train_accuracy: the accuracy of the model with respect to the training dataset (i.e. use the training dataset to evaluate the model and return the accuracy of the model) as a percentage (i.e. between 0 to 100)
'''
### BEGIN SOLUTION
return t_model, train_accuracy # Return trained model and training accuracy as percentage
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

What are the purposes of collection messages? (Objective 5)

Answered: 1 week ago