Created
June 9, 2019 06:25
-
-
Save shubham0204/c4c4a874bbf86c84b1921275aac34e60 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| fun fit ( x : Array<DoubleArray> , y: DoubleArray , epochs : Int , batchSize: Int ) { | |
| val batches = batch( x , y , batchSize ) | |
| for ( e in 0 until epochs ) { | |
| for ( batch in batches ) { | |
| val gradients = ArrayList<Array<Any>>() | |
| for ( pair in batch ) { | |
| val predictions = forwardPropogate( pair.first ) | |
| gradients.add( calculateGradients( pair.first , predictions , pair.second ) ) | |
| } | |
| optimizeParameters( gradients , 0.001 ) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment