Skip to content

Latest commit

 

History

History
112 lines (61 loc) · 2.4 KB

result.md

File metadata and controls

112 lines (61 loc) · 2.4 KB

Globals / Result /

Class: Result

Just a little wrapper around the result of a request to TensorflowJS. Because every single result is made through WebGL, we need to create async tasks. So we remove the async side by using the dataSync() method to get at the moment the result, instead of returning a Promise.

Hierarchy

  • Result

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Result(result: Tensor): Result

Defined in reimprove/model.ts:174

Parameters:

Name Type
result Tensor

Returns: Result


Properties

Private result

result: Tensor

Defined in reimprove/model.ts:176


Methods

getAction

getAction(): number

Defined in reimprove/model.ts:196

Returns the index of the highest value of an 1D tensor

Returns: number


getHighestValue

getHighestValue(): number

Defined in reimprove/model.ts:188

Returns the highest value of an 1D tensor

Returns: number


Private getResultAndDispose

getResultAndDispose(t: Tensor): Float32Array | Int32Array | Uint8Array

Defined in reimprove/model.ts:179

Parameters:

Name Type
t Tensor

Returns: Float32Array | Int32Array | Uint8Array


getValue

getValue(): Int32Array | Float32Array | Uint8Array

Defined in reimprove/model.ts:204

Returns an array reflecting the initial result tensor

Returns: Int32Array | Float32Array | Uint8Array