Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Commit

Permalink
show weights with each round
Browse files Browse the repository at this point in the history
  • Loading branch information
gav5 committed Apr 17, 2018
1 parent 423e338 commit b96a90e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import threshold from '../lib/threshold'
import trainingRate from '../lib/trainingRate'
import lightDarkLabel from '../lib/lightDarkLabel'
import isPixelLight from '../lib/isPixelLight'
import formatWeight from '../lib/formatWeight'
import { times, constant, last, map, clone, concat, reduce, result } from 'lodash'

import {
Expand All @@ -40,7 +41,6 @@ export default class extends Component {
input: val,
correct: isImageLight(val) ? +1 : -1
})
console.log(`newRow: ${newRow.weights}`)
return concat(acc, [newRow])
}, [])

Expand Down Expand Up @@ -164,7 +164,19 @@ export default class extends Component {
)}
{this.isStageTraining(this.state.stage) &&
<div>
<Header>Training Table</Header>
<TrainingTable round={this.state.rounds[this.state.stage-1]} />
<Header>Weights</Header>
<Table>
<Table.Body>
<Table.Row>
{map(last(this.state.rounds[this.state.stage-1]).newWeights, (w)=> (
<Table.Cell textAlign='center'>{formatWeight(w)}</Table.Cell>
))}
</Table.Row>
</Table.Body>
</Table>
<Header>Test Results</Header>
<Grid columns={2}>
{map(this.state.results[this.state.stage-1], (x, i)=> (
<Grid.Column key={i}>
Expand Down

0 comments on commit b96a90e

Please sign in to comment.