Initial commit
This commit is contained in:
commit
1995df58ce
21 changed files with 6708 additions and 0 deletions
14
net/optimizer.py
Normal file
14
net/optimizer.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class Optimizers:
|
||||
@staticmethod
|
||||
def gradient_descent(params, grads, alpha):
|
||||
"""
|
||||
Performs gradient descent optimization for a multi-layer network.
|
||||
|
||||
:param params: Dictionary containing the network parameters (W1, b1, W2, b2, etc.)
|
||||
:param grads: Dictionary containing the gradients (dW1, db1, dW2, db2, etc.)
|
||||
:param alpha: Learning rate
|
||||
:return: Updated parameters dictionary
|
||||
"""
|
||||
for key in params:
|
||||
params[key] -= alpha * grads['d' + key]
|
||||
return params
|
||||
Loading…
Add table
Add a link
Reference in a new issue