Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DeepLearningClassification

Deep Learning Classification with Tensorflow

implements

{BaseNeuralNetwork}

Hierarchy

Index

Constructors

constructor

Properties

compiled

compiled: boolean

getInputShape

getInputShape: (...args: any[]) => any

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

Optional getTimeseriesShape

getTimeseriesShape: (x_timeseries: undefined | NestedArray<any>) => Shape

Type declaration

    • (x_timeseries: undefined | NestedArray<any>): Shape
    • Parameters

      • x_timeseries: undefined | NestedArray<any>

      Returns Shape

Optional layers

layers: TensorScriptLayers | TensorScriptSavedLayers

Optional loss

loss: number

model

model: any

reshape

reshape: (...args: any[]) => any

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

settings

settings: TensorScriptOptions

tf

tf: any

tokenizer

tokenizer: any

trained

trained: boolean

type

type: string

Optional xShape

xShape: number[]

Optional yShape

yShape: number[]

Methods

calculate

  • calculate(input_matrix: Vector | Matrix, options?: PredictionOptions): any
  • Predicts new dependent variables

    override

    Parameters

    • input_matrix: Vector | Matrix
    • Optional options: PredictionOptions

      model prediction options

    Returns any

    returns tensorflow prediction

exportConfiguration

  • exportConfiguration(): TensorScriptContext

generateLayers

  • generateLayers(x_matrix: Matrix, y_matrix: Matrix, layers?: TensorScriptLayers): void
  • Adds dense layers to tensorflow classification model

    override

    Parameters

    • x_matrix: Matrix

      independent variables

    • y_matrix: Matrix

      dependent variables

    • Optional layers: TensorScriptLayers

      model dense layer parameters

    Returns void

importConfiguration

  • importConfiguration(configuration: TensorScriptContext): void

loadModel

  • loadModel(options: string): Promise<any>

predict

  • predict(input_matrix?: Vector | Matrix | InputTextArray | PredictionOptions, options?: PredictionOptions): Promise<any>
  • Returns prediction values from tensorflow model

    Parameters

    • Optional input_matrix: Vector | Matrix | InputTextArray | PredictionOptions

      new test independent variables

    • Optional options: PredictionOptions

    Returns Promise<any>

    predicted model values

saveModel

  • saveModel(options: string): Promise<any>

train

  • train(x_matrix: Matrix, y_matrix: Matrix, layers?: TensorScriptLayers, x_test?: Matrix, y_test?: Matrix): Promise<any>
  • Asynchronously trains tensorflow model

    override

    Parameters

    • x_matrix: Matrix

      independent variables

    • y_matrix: Matrix

      dependent variables

    • Optional layers: TensorScriptLayers

      array of model dense layer parameters

    • Optional x_test: Matrix
    • Optional y_test: Matrix

    Returns Promise<any>

    returns trained tensorflow model

Static getInputShape

  • getInputShape(matrix?: any): Shape

Static reshape

  • reshape(array: Vector, shape: Shape): Vector | Matrix
  • Reshapes an array

    function
    example

    const array = [ 0, 1, 1, 0, ]; const shape = [2,2]; TensorScriptModelInterface.reshape(array,shape) // => [ [ 0, 1, ], [ 1, 0, ], ];

    Parameters

    • array: Vector

      input array

    • shape: Shape

      shape array

    Returns Vector | Matrix

    returns a matrix with the defined shape