Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102742552
stochastic_gradient_descent.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Feb 23, 17:36
Size
839 B
Mime Type
text/x-python
Expires
Tue, Feb 25, 17:36 (2 d)
Engine
blob
Format
Raw Data
Handle
24418247
Attached To
rTZUCT ML_Project1
stochastic_gradient_descent.py
View Options
# -*- coding: utf-8 -*-
"""Stochastic Gradient Descent"""
def
compute_stoch_gradient
(
y
,
tx
,
w
):
"""Compute a stochastic gradient from just few examples n and their corresponding y_n labels."""
# ***************************************************
# INSERT YOUR CODE HERE
# TODO: implement stochastic gradient computation.It's same as the gradient descent.
# ***************************************************
raise
NotImplementedError
def
stochastic_gradient_descent
(
y
,
tx
,
initial_w
,
batch_size
,
max_iters
,
gamma
):
"""Stochastic gradient descent algorithm."""
# ***************************************************
# INSERT YOUR CODE HERE
# TODO: implement stochastic gradient descent.
# ***************************************************
raise
NotImplementedError
return
losses
,
ws
Event Timeline
Log In to Comment