Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NeuralNetwork<TNetParams>

Type parameters

  • TNetParams

Hierarchy

Index

Constructors

constructor

  • Parameters

    • _name: string

    Returns NeuralNetwork

Properties

Protected _name

_name: string

Protected _paramMappings

_paramMappings: ParamMapping[] = []

Protected _params

_params: TNetParams | undefined = undefined

Accessors

isLoaded

  • get isLoaded(): boolean
  • Returns boolean

paramMappings

  • get paramMappings(): ParamMapping[]
  • Returns ParamMapping[]

params

  • get params(): TNetParams | undefined
  • Returns TNetParams | undefined

Methods

dispose

  • dispose(throwOnRedispose?: boolean): void
  • Parameters

    • Default value throwOnRedispose: boolean = true

    Returns void

Protected Abstract extractParams

  • extractParams(weights: Float32Array): object
  • Parameters

    • weights: Float32Array

    Returns object

Protected Abstract extractParamsFromWeigthMap

  • extractParamsFromWeigthMap(weightMap: tf.NamedTensorMap): object
  • Parameters

    • weightMap: tf.NamedTensorMap

    Returns object

extractWeights

  • extractWeights(weights: Float32Array): void
  • Parameters

    • weights: Float32Array

    Returns void

freeze

  • freeze(): void
  • Returns void

Protected Abstract getDefaultModelName

  • getDefaultModelName(): string
  • Returns string

getFrozenParams

  • getFrozenParams(): object[]
  • Returns object[]

getParamFromPath

  • getParamFromPath(paramPath: string): tf.Tensor
  • Parameters

    • paramPath: string

    Returns tf.Tensor

getParamList

  • getParamList(): object[]
  • Returns object[]

getTrainableParams

  • getTrainableParams(): object[]
  • Returns object[]

load

  • load(weightsOrUrl: Float32Array | string | undefined): Promise<void>
  • Parameters

    • weightsOrUrl: Float32Array | string | undefined

    Returns Promise<void>

loadFromDisk

  • loadFromDisk(filePath: string | undefined): Promise<void>
  • Parameters

    • filePath: string | undefined

    Returns Promise<void>

loadFromUri

  • loadFromUri(uri: string | undefined): Promise<void>
  • Parameters

    • uri: string | undefined

    Returns Promise<void>

loadFromWeightMap

  • loadFromWeightMap(weightMap: tf.NamedTensorMap): void
  • Parameters

    • weightMap: tf.NamedTensorMap

    Returns void

reassignParamFromPath

  • reassignParamFromPath(paramPath: string, tensor: tf.Tensor): void
  • Parameters

    • paramPath: string
    • tensor: tf.Tensor

    Returns void

serializeParams

  • serializeParams(): Float32Array
  • Returns Float32Array

variable

  • variable(): void
  • Returns void

Generated using TypeDoc