Skip to content

Commit

Permalink
changes to cnn defaults for task image classification
Browse files Browse the repository at this point in the history
  • Loading branch information
shiffman authored and bomanimc committed Nov 4, 2020
1 parent 97a4478 commit d226e64
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/NeuralNetwork/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ const DEFAULTS = {
class DiyNeuralNetwork {
constructor(options, cb) {
this.callback = cb;

// Is there a better way to handle a different
// default learning rate for image classification tasks?
if (options.task === 'imageClassification') {
DEFAULTS.learningRate = 0.02;
}

this.options =
{
...DEFAULTS,
Expand Down Expand Up @@ -687,29 +694,29 @@ class DiyNeuralNetwork {
layers = [
{
type: 'conv2d',
filters: 2,
kernelSize: 2,
strides: 2,
filters: 8,
kernelSize: 5,
strides: 1,
activation: 'relu',
kernelInitializer: 'varianceScaling',
},
{
type: 'maxPooling2d',
poolSize: [1, 1],
strides: [1, 1],
poolSize: [2, 2],
strides: [2, 2],
},
{
type: 'conv2d',
filters: 1,
kernelSize: 1,
filters: 16,
kernelSize: 5,
strides: 1,
activation: 'relu',
kernelInitializer: 'varianceScaling',
},
{
type: 'maxPooling2d',
poolSize: [1, 1],
strides: [1, 1],
poolSize: [2, 2],
strides: [2, 2],
},
{
type: 'flatten',
Expand Down

0 comments on commit d226e64

Please sign in to comment.