Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1. Load MNIST data and scale it (code provided). Estimate a neural network with: epochs =20, batch_size = 100, and one hidden layer with

Problem 1. Load MNIST data and scale it (code provided). Estimate a neural network with: epochs =20, batch_size = 100, and one hidden layer with 400 neurons. Measure and report validation accuracy and estimation time.

PLEASE DON'T USE RandomizedCV with this assignment, it will not work with TensorFlow.

the given code:

import numpy as np

import os

import random

random.seed(42)

np.random.seed(42)

import tensorflow as tf

def reset_graph(seed=42):

tf.reset_default_graph()

tf.set_random_seed(seed)

np.random.seed(seed)

(X_train, y_train), (X_test, y_test) = tf.keras.datasets.mnist.load_data()

X_train = X_train.astype(np.float32).reshape(-1, 28*28) / 255.0

X_test = X_test.astype(np.float32).reshape(-1, 28*28) / 255.0

y_train = y_train.astype(np.int32)

y_test = y_test.astype(np.int32)

X_valid, X_train = X_train[:5000], X_train[5000:]

y_valid, y_train = y_train[:5000], y_train[5000:]

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions