Gradient descent: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 380:
load 'math/calculus'
coinsert 'jcalculus'
 
ps=: 9!:11
NB. initial guess
ps 18
 
go=: 0.1 _1
 
NB. function
 
func=: monad define
Line 388 ⟶ 391:
((1-xp)*(1-xp) * ] ^-(yp)^2) + yp*(yp+2)* ] ^ _2 * xp^2 NB. evaluates from right to left without precedence
)
 
NB. gradient descent
 
shortygd =: monad define
Line 401 ⟶ 406:
{{out}}
<pre>
0.107627 _1.22326
0.107626780140768125 _1.22325973233483509
</pre>
 
 
8

edits