Home Reference Source Repository

Function

Static Public Summary
public

dropoutLayer(layer: Matrix, pDropout: number): Matrix

Randomly drop values from a layer.

public

norm(mu: number, sigma: number): number

Return a sample from a normal distribution.

public

randn(rows: number, cols: number): Matrix

Return a matrix, all of whose element are sampled from the standard normal distribution.

public

sigmoidPrime(z: Matrix): Matrix

Derivative of the sigmoid function.

public

vectorizedResult(j: number): Matrix

Return a 10-dimensional unit vector with a 1.0 in the j'th position and zeroes elsewhere. This is used to convert a digit (0...9) into a corresponding desired output from the neural network.

Static Public

public dropoutLayer(layer: Matrix, pDropout: number): Matrix source

import {dropoutLayer} from 'js-mind/src/lib.js'

Randomly drop values from a layer.

Params:

NameTypeAttributeDescription
layer Matrix
pDropout number

probability to drop out value for each element

Return:

Matrix

converted matrix with the same nRow, nCol

public norm(mu: number, sigma: number): number source

import {norm} from 'js-mind/src/lib.js'

Return a sample from a normal distribution.

Params:

NameTypeAttributeDescription
mu number

mean

sigma number

sd (must be greater than 0)

Return:

number

sample

public randn(rows: number, cols: number): Matrix source

import {randn} from 'js-mind/src/lib.js'

Return a matrix, all of whose element are sampled from the standard normal distribution. see http://d.hatena.ne.jp/iroiro123/20111210/1323515616

Params:

NameTypeAttributeDescription
rows number

the number of rows

cols number

the number of cols

Return:

Matrix

random matrix

public sigmoidPrime(z: Matrix): Matrix source

import {sigmoidPrime} from 'js-mind/src/lib.js'

Derivative of the sigmoid function.

Params:

NameTypeAttributeDescription
z Matrix

Return:

Matrix

converted matrix with the same nRow, nCol

public vectorizedResult(j: number): Matrix source

import {vectorizedResult} from 'js-mind/src/lib.js'

Return a 10-dimensional unit vector with a 1.0 in the j'th position and zeroes elsewhere. This is used to convert a digit (0...9) into a corresponding desired output from the neural network.

Params:

NameTypeAttributeDescription
j number

interger: zero to nine

Return:

Matrix

10x1