forked from BrainJS/brain.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
55 lines (46 loc) · 1.63 KB
/
index.d.ts
File metadata and controls
55 lines (46 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
export interface INeuralNetworkDefaultOptions {
binaryThresh: number;
hiddenLayers: number[];
activation: NeuralNetworkActivation
}
export type NeuralNetworkActivation = 'sigmoid' | 'relu' | 'leaky-relu' | 'tanh';
export interface INeuralNetworkTrainingOptions {
iterations?: number;
errorThresh?: number;
log?: boolean;
logPeriod?: number;
learningRate?: number;
momentum?: number;
callback?: INeuralNetworkTrainingCallback | number;
callbackPeriod?: number;
timeout?: number;
}
export interface INeuralNetworkTrainingCallback {
(state: INeuralNetworkState): void;
}
export interface INeuralNetworkState {
iterations: number;
error: number;
}
export interface ITrainStream {
write<T>(data: T): void;
}
export interface ITrainStreamOptions {
floodCallback?: () => void;
doneTrainingCallback?: (obj: any) => void;
}
export class NeuralNetwork {
public constructor(options?: INeuralNetworkDefaultOptions);
public train<T>(data: T, options?: INeuralNetworkTrainingOptions): INeuralNetworkState;
public train(data: any[], options?: INeuralNetworkTrainingOptions): INeuralNetworkState;
public trainAsync<T>(data: T, options?: INeuralNetworkTrainingOptions): Promise<INeuralNetworkState>;
public trainAsync(data: any, options?: INeuralNetworkTrainingOptions): Promise<INeuralNetworkState>;
public run<T>(data: string | number | string[] | number[]): T;
public fromJSON<T>(json: T);
public toJSON<T>(): T;
public createTrainStream(options: ITrainStreamOptions): ITrainStream;
}
export declare namespace recurrent {
class LSTM extends NeuralNetwork {}
}
export function likely<T>(input: T, net: NeuralNetwork): any;