Last active
May 21, 2020 21:35
-
-
Save akarsh-saxena/1459b3a2e62c9c931a12f6dbdbbb8e21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def initialize_nn(X): | |
"""Initializes random weights and bias | |
Arguments | |
--------- | |
X: array-like | |
Train Dataset | |
Returns | |
------- | |
dict | |
Contains the randomly initialized weights and bias arrays where- | |
shape(weights) = (X.Shape[0], 1) | |
bias = float value | |
The keys for weights and bias arrays in the dict is 'w' and 'b' | |
""" | |
np.random.seed(999) | |
w = np.random.randn(X.shape[1], 1) * 0.01 | |
b = 0 | |
return {'w': w, 'b': b} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment