Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Discrete

A Discrete Space class.

Used for spaces with a discrete sample space as opposed to continuous.

example
const disc = new Discrete([6]);
console.log(disc.toString());
> Discrete: [6]

const sample = disc.sample();
console.log(sample);
> 2

Hierarchy

  • Discrete

Implements

Index

Constructors

constructor

  • new Discrete(shape: number[]): Discrete
  • Parameters

    • shape: number[]

      The shape of the space

    Returns Discrete

Properties

length

length: number

sampleSpace

sampleSpace: tf.Tensor

seedValue

seedValue: number

shape

shape: number[]

type

type: any

Methods

get

  • get(): tf.Tensor
  • Returns tf.Tensor

sample

  • sample(): number
  • Sample a random value from this Space.

    Returns number

    • A random sample.

seed

  • seed(seed: number): void
  • Parameters

    • seed: number

    Returns void

set

  • set(space: tf.Tensor): void
  • Parameters

    • space: tf.Tensor

    Returns void

toString

  • toString(): string
  • Returns string

Generated using TypeDoc