Skip to content

pull #8

Merged
merged 10 commits into from
Apr 14, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix HW6 gradient of cost equation
rcc02007 committed Apr 10, 2017
commit ee2c3e2428aee8be6685299da362311d8a2a4d43
6 changes: 4 additions & 2 deletions HW6/README.md
Original file line number Diff line number Diff line change
@@ -34,12 +34,14 @@ variable is failure (1=fail, 0=pass). Create a function called `cost_logistic.m`
takes the vector `a`, and independent variable `x` and dependent variable `y`. Use the
function, $\sigma(t)=\frac{1}{1+e^{-t}}$ where $t=a_{0}+a_{1}x$. Use the cost function,

$J(a_{0},a_{1})=\sum_{i=1}^{n}\left[-y_{i}\log(\sigma(t_{i}))-(1-y_{i})\log((1-\sigma(t_{i})))\right]$
$J(a_{0},a_{1})=1/m\sum_{i=1}^{n}\left[-y_{i}\log(\sigma(t_{i}))-(1-y_{i})\log((1-\sigma(t_{i})))\right]$

and gradient

$\frac{\partial J}{\partial a_{i}}=
1/m\sum_{k=1}^{N}\left(\sigma(t_{k})-y_{k}\right)t_{k}$
1/m\sum_{k=1}^{N}\left(\sigma(t_{k})-y_{k}\right)x_{k}^{i}$

where $x_{k}^{i} is the k-th value of temperature raised to the i-th power (0, and 1)

a. edit `cost_logistic.m` so that the output is `[J,grad]` or [cost, gradient]

Binary file modified lecture_17/octave-workspace
Binary file not shown.
Binary file modified lecture_18/octave-workspace
Binary file not shown.
Binary file modified lecture_19/octave-workspace
Binary file not shown.
Binary file added lecture_20/octave-workspace
Binary file not shown.
6 changes: 6 additions & 0 deletions lecture_21/.ipynb_checkpoints/lecture_21-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}
430 changes: 430 additions & 0 deletions lecture_21/lecture_21.ipynb

Large diffs are not rendered by default.

Binary file added lecture_21/q1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lecture_21/q2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lecture_21/reduce_noise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.