Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Copy

A 1D algorithmic environment where the target is the same as the observation.

The 1D TapeAlgorithmicEnv has an action_space tuple with shape [2,2,10]. The first item is the chosen movement, either left or right. The second item is whether to write to the current position or not. Finally, the last value is the actual value to write to the tape in the current position. The environment terminates immediately when an incorrect item is written or when the entire output is successfully outputted. The MIN_LENGTH of the tape is 5 plus a random number between 0 and 2.

example
import {Copy} from "gym-js";
let base = 10;
const env = new Copy(base);

console.log(env.action_space.toString());
> DiscreteTuple: 2,2,10
console.log(env.observation_space.toString());
> Discrete: 11

let action = env.action_space.sample();
let [obs, rew, done, info] = env.step(action);

Hierarchy

Implements

Index

Constructors

constructor

  • new Copy(base?: number): Copy

Properties

MIN_LENGTH

MIN_LENGTH: number

MOVEMENTS

MOVEMENTS: string[]

action_space

action_space: DiscreteTuple

agentActions

agentActions: number[]

base

base: number

charmap

charmap: string[]

cursor

cursor: number

done

done: boolean

inputData

inputData: any

observation_space

observation_space: Discrete

reward

reward: number

reward_range

reward_range: Discrete

target

target: []

targetLength

targetLength: number

Methods

close

  • close(): void

genInputData

  • genInputData(size: number): any

getStrObs

  • getStrObs(): string

move

render

  • render(): void

renderHTML

  • renderHTML(): string

reset

  • reset(): tf.Tensor

seed

  • seed(seed: number): void
  • Parameters

    • seed: number

    Returns void

setTarget

  • setTarget(input_data: any): void
  • Parameters

    • input_data: any

    Returns void

step

  • step(action: actionSpace): [tf.Tensor, number, boolean, __type]
  • Parameters

    Returns [tf.Tensor, number, boolean, __type]

toObs

  • toObs(): any

Generated using TypeDoc