Skip to content

Commit

Permalink
fix: Add more unit tests and fixes for consistency for CrossValidate
Browse files Browse the repository at this point in the history
  • Loading branch information
robertleeplummerjr committed Nov 30, 2018
1 parent 7489388 commit 52d137e
Show file tree
Hide file tree
Showing 15 changed files with 1,395 additions and 575 deletions.
1,485 changes: 1,046 additions & 439 deletions browser.js

Large diffs are not rendered by default.

49 changes: 21 additions & 28 deletions browser.min.js

Large diffs are not rendered by default.

64 changes: 38 additions & 26 deletions dist/cross-validate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cross-validate.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/neural-network-gpu.js.map

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions dist/neural-network.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/neural-network.js.map

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions dist/recurrent/rnn-time-step.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/recurrent/rnn-time-step.js.map

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface INeuralNetworkOptions {
binaryThresh?: number;
hiddenLayers?: number[];
activation?: NeuralNetworkActivation;
leakyReluAlpha?: number;
}

export type NeuralNetworkActivation = 'sigmoid' | 'relu' | 'leaky-relu' | 'tanh';
Expand Down Expand Up @@ -47,8 +48,19 @@ export interface INeuralNetworkTrainingData {
export type NeuralNetworkInput = number[];

export interface INeuralNetworkTestResult {
misclasses: any,
error: number
misclasses: any;
error: number;
total: number;
}

export interface INeuralNetworkBinaryTestResult extends INeuralNetworkTestResult {
trueNeg: number;
truePos: number;
falseNeg: number;
falsePos: number;
precision: number;
recall: number;
accuracy: number;
}

export class NeuralNetwork {
Expand All @@ -57,7 +69,7 @@ export class NeuralNetwork {
public train<T>(data: T, options?: INeuralNetworkTrainingOptions): INeuralNetworkState;
public trainAsync(data: INeuralNetworkTrainingData, options?: INeuralNetworkTrainingOptions): Promise<INeuralNetworkState>;
public trainAsync<T>(data: T, options?: INeuralNetworkTrainingOptions): Promise<INeuralNetworkState>;
public test(data: INeuralNetworkTrainingData): INeuralNetworkTestResult;
public test(data: INeuralNetworkTrainingData): INeuralNetworkTestResult | INeuralNetworkBinaryTestResult;
public run(data: NeuralNetworkInput): NeuralNetworkInput;
public run<T>(data: NeuralNetworkInput): T;
public run<TInput, TOutput>(data: TInput): TOutput;
Expand Down
Loading

0 comments on commit 52d137e

Please sign in to comment.