import {BaseNeuralNetwork} from '@tensorscript/ts-deeplearning/lib/deeplearning.mjs'
BaseNeuralNetwork
Extends:
Implements:
- TensorScriptModelInterface
Direct Implemented:
Deep Learning with Tensorflow
Constructor Summary
Public Constructor | ||
public |
constructor(options: {layers: Array<Object>, compile: Object, fit: Object}, properties: *) |
Method Summary
Public Methods | ||
public |
calculate(matrix: Array<Array<number>>|Array<number>): {data: Promise} Predicts new dependent variables |
|
public abstract |
generateLayers(x_matrix: Array<Array<number>>, y_matrix: Array<Array<number>>, layers: Array<Object>) Adds dense layers to tensorflow model |
|
public |
async train(x_matrix: Array<Array<number>>, y_matrix: Array<Array<number>>, layers: Array<Object>, x_text: Array<Array<number>>, y_text: Array<Array<number>>): Object Asynchronously trains tensorflow model |
Public Constructors
public constructor(options: {layers: Array<Object>, compile: Object, fit: Object}, properties: *) source
Params:
Name | Type | Attribute | Description |
options | {layers: Array<Object>, compile: Object, fit: Object} | neural network configuration and tensorflow model hyperparameters |
|
properties | * | extra instance properties |
Public Methods
public calculate(matrix: Array<Array<number>>|Array<number>): {data: Promise} source
Predicts new dependent variables
Params:
Name | Type | Attribute | Description |
matrix | Array<Array<number>>|Array<number> | new test independent variables |
Return:
{data: Promise} | returns tensorflow prediction |
public abstract generateLayers(x_matrix: Array<Array<number>>, y_matrix: Array<Array<number>>, layers: Array<Object>) source
Adds dense layers to tensorflow model
Params:
Name | Type | Attribute | Description |
x_matrix | Array<Array<number>> | independent variables |
|
y_matrix | Array<Array<number>> | dependent variables |
|
layers | Array<Object> | model dense layer parameters |
public async train(x_matrix: Array<Array<number>>, y_matrix: Array<Array<number>>, layers: Array<Object>, x_text: Array<Array<number>>, y_text: Array<Array<number>>): Object source
Asynchronously trains tensorflow model
Params:
Name | Type | Attribute | Description |
x_matrix | Array<Array<number>> | independent variables |
|
y_matrix | Array<Array<number>> | dependent variables |
|
layers | Array<Object> | array of model dense layer parameters |
|
x_text | Array<Array<number>> | validation data independent variables |
|
y_text | Array<Array<number>> | validation data dependent variables |
Return:
Object | returns trained tensorflow model |