Computer Science  >  CODING SOLUTION  >  CS 4641 Machine Learning- NN.py Import numpy as np ''' We are going to use the diabetes dataset (All)

CS 4641 Machine Learning- NN.py Import numpy as np ''' We are going to use the diabetes dataset

Document Content and Description Below

import numpy as np ''' We are going to use the diabetes dataset provided by sklearn https://scikit-learn.org/stable/datasets/toy_dataset.html#diabetes-dataset to train a 2 fully connected layer ne ... ural net. We are going to build the neural network from scratch. ''' class dlnet: def __init__(self, x, y, lr = 0.01, batch_size=64, momentum=0.5, use_dropout=True, dropout_prob=0.3): ''' This method initializes the class, it is implemented for you. Args: x: data y: labels Yh: predicted labels dims: dimensions of different layers alpha: slope coefficient for leaky relu param: dictionary of different layers parameters ch: Cache dictionary to store forward parameters that are used in backpropagation loss: list to store loss values lr: learning rate sam: number of training samples we have momentum: coefficient for momentum-based update step change: dict of previous changes for each layer ''' self.X=x # features self.Y=y # ground truth labels self.Yh=np.zeros((1,self.Y.shape[1])) # estimated labels self.dims = [10, 15, 1] # dimensions of different layers self.alpha = 0.05 self.use_dropout = use_dropout self.dropout_prob = dropout_prob self.param = {} # dictionary for different layer variables self.ch = {} # cache for holding variables during forward propagation to use them in back prop self.loss = [] # list to store loss values self.batch_y = [] # [Show More]

Last updated: 1 year ago

Preview 2 out of 8 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Loading document previews for CS 4641 Machine Learning- NN.py Import numpy as np ''' We are going to use the diabetes dataset

Loading document previews ...

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$9.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

143
0

Document information


Connected school, study & course


About the document


Uploaded On

Apr 23, 2023

Number of pages

8

Written in

All

Seller


Profile illustration for PAPERS UNLIMITED™
PAPERS UNLIMITED™

Member since 4 years

509 Documents Sold

Reviews Received
55
20
8
2
8
Additional information

This document has been written for:

Uploaded

Apr 23, 2023

Downloads

 0

Views

 143

More From PAPERS UNLIMITED™

View all PAPERS UNLIMITED™'s documents »

Recommended For You

Get more on CODING SOLUTION »

$9.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·