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.
- Result
+ new Result(result
: Tensor
): Result
Defined in reimprove/model.ts:174
Parameters:
Name | Type |
---|---|
result |
Tensor |
Returns: Result
● result: Tensor
Defined in reimprove/model.ts:176
▸ getAction(): number
Defined in reimprove/model.ts:196
Returns the index of the highest value of an 1D tensor
Returns: number
▸ getHighestValue(): number
Defined in reimprove/model.ts:188
Returns the highest value of an 1D tensor
Returns: number
▸ getResultAndDispose(t
: Tensor
): Float32Array
| Int32Array
| Uint8Array
Defined in reimprove/model.ts:179
Parameters:
Name | Type |
---|---|
t |
Tensor |
Returns: Float32Array
| Int32Array
| Uint8Array
▸ getValue(): Int32Array
| Float32Array
| Uint8Array
Defined in reimprove/model.ts:204
Returns an array reflecting the initial result tensor
Returns: Int32Array
| Float32Array
| Uint8Array