JSON SCHEMA ReLeSO

The input file must be written to comply to the following json-schema.

BaseParser

Class parses the experiment definition and conducts the training.

This class can be used to initialize the ReLeSO Framework from the command line by reading in a json representation of the RL based Shape Optimization problem which is to be solved via Reinforcement Learning.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • verbosity

Verbosity

  • agent

Agent

anyOf

PPOAgent

DDPGAgent

SACAgent

PretrainedAgent

DQNAgent

A2CAgent

  • environment

Environment

  • number_of_timesteps

Number Of Timesteps

type

integer

minimum

1

  • number_of_episodes

Number Of Episodes

type

integer

minimum

1

  • validation

Validation

  • n_environments

N Environments

type

integer

minimum

1

default

1

  • normalize_training_values

Normalize Training Values

type

boolean

default

False

  • multi_env_sequential

Multi Env Sequential

type

boolean

default

False

  • episode_log_update

Episode Log Update

type

integer

minimum

1

default

100

  • export_step_log

Export Step Log

type

boolean

default

False

  • step_log_update

Step Log Update

type

integer

minimum

0

default

0

  • step_log_info

Step Log Info

type

boolean

default

False

additionalProperties

False

Verbosity

Verbosity class.

Defines the settings for the different loggers used in the current experiment. This class is the only class which is copied to all children. (this happens outside of the the standard channels and will hopefully not break with multiprocessing)

Please note, the parser logger only ever can have the following name ReLeSO_parser

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • parser

Parser

type

string

enum

ERROR, WARNING, DEBUG, INFO

default

INFO

  • environment

Environment

type

string

enum

ERROR, WARNING, DEBUG, INFO

default

INFO

  • logfile_location

Logfile Location

type

string

default

logging/

  • console_logging

Console Logging

type

boolean

default

False

  • base_logger_name

Base Logger Name

type

string

default

ReLeSO

  • environment_extension

Environment Extension

type

string

default

environment

additionalProperties

False

PPOAgent

PPO agent definition.

PPO definition for the stable_baselines3 implementation for this algorithm. Variable comments are taken from the stable_baselines3 documentation.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • tensorboard_log

Tensorboard Log

type

string

  • policy

Policy

type

string

enum

MlpPolicy, CnnPolicy, MultiInputPolicy

  • use_custom_feature_extractor

Use Custom Feature Extractor

type

string

enum

resnet18, mobilenet_v2

  • cfe_without_linear

Cfe Without Linear

type

boolean

default

False

  • policy_kwargs

Policy Kwargs

type

object

  • type

Type

type

string

enum

PPO

  • learning_rate

Learning Rate

type

number

default

0.0003

  • n_steps

N Steps

type

integer

default

2048

  • batch_size

Batch Size

type

integer

default

64

  • n_epochs

N Epochs

type

integer

default

10

  • gamma

Gamma

type

number

default

0.99

  • gae_lambda

Gae Lambda

type

number

default

0.95

  • clip_range

Clip Range

type

number

default

0.2

  • ent_coef

Ent Coef

type

number

default

0.0

  • vf_coef

Vf Coef

type

number

default

0.5

  • seed

Seed

type

integer

  • device

Device

type

string

default

auto

additionalProperties

False

DDPGAgent

DDPG agent definition.

DDPG definition for the stable_baselines3 implementation for this algorithm. Variable comments are taken from the stable_baselines3 documentation.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • tensorboard_log

Tensorboard Log

type

string

  • policy

Policy

type

string

enum

MlpPolicy, CnnPolicy, MultiInputPolicy

  • use_custom_feature_extractor

Use Custom Feature Extractor

type

string

enum

resnet18, mobilenet_v2

  • cfe_without_linear

Cfe Without Linear

type

boolean

default

False

  • policy_kwargs

Policy Kwargs

type

object

  • type

Type

type

string

enum

DDPG

  • learning_rate

Learning Rate

type

number

default

0.001

  • buffer_size

Buffer Size

type

integer

default

100000

  • learning_starts

Learning Starts

type

integer

default

100

  • batch_size

Batch Size

type

integer

default

64

  • tau

Tau

type

number

default

0.005

  • gamma

Gamma

type

number

default

0.99

  • optimize_memory_usage

Optimize Memory Usage

type

boolean

default

False

  • seed

Seed

type

integer

  • device

Device

type

string

default

auto

additionalProperties

False

SACAgent

SAC Agent definition.

SAC definition for the stable_baselines3 implementation for this algorithm. Variable comments are taken from the stable_baselines3 documentation.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • tensorboard_log

Tensorboard Log

type

string

  • policy

Policy

type

string

enum

MlpPolicy, CnnPolicy, MultiInputPolicy

  • use_custom_feature_extractor

Use Custom Feature Extractor

type

string

enum

resnet18, mobilenet_v2

  • cfe_without_linear

Cfe Without Linear

type

boolean

default

False

  • policy_kwargs

Policy Kwargs

type

object

  • type

Type

type

string

enum

SAC

  • learning_rate

Learning Rate

type

number

default

0.001

  • buffer_size

Buffer Size

type

integer

default

1000000

  • learning_starts

Learning Starts

type

integer

default

100

  • batch_size

Batch Size

type

integer

default

64

  • tau

Tau

type

number

default

0.005

  • gamma

Gamma

type

number

default

0.99

  • optimize_memory_usage

Optimize Memory Usage

type

boolean

default

False

  • ent_coef

Ent Coef

default

auto

anyOf

type

string

type

number

  • target_update_interval

Target Update Interval

type

integer

default

1

  • target_entropy

Target Entropy

default

auto

anyOf

type

string

type

number

  • use_sde

Use Sde

type

boolean

default

False

  • sde_sample_freq

Sde Sample Freq

type

integer

default

-1

  • use_sde_at_warmup

Use Sde At Warmup

type

boolean

default

False

  • seed

Seed

type

integer

  • device

Device

type

string

default

auto

additionalProperties

False

PretrainedAgent

Pretrained agent definition.

This class can be used to load pretrained agents, instead of using untrained agents. Can also be used to only validate this agent without training it further. Please see validation section for this use-case.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • tensorboard_log

Tensorboard Log

type

string

  • type

Type

type

string

enum

PPO, SAC, DDPG, A2C, DQN

  • path

Path

anyOf

type

string

format

file-path

type

string

format

path

  • tesorboard_run_directory

Tesorboard Run Directory

anyOf

type

string

type

string

format

path

additionalProperties

False

DQNAgent

DQN Agent definition.

DQN definition for the stable_baselines3 implementation for this algorithm. Variable comments are taken from the stable_baselines3 documentation.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • tensorboard_log

Tensorboard Log

type

string

  • policy

Policy

type

string

enum

MlpPolicy, CnnPolicy, MultiInputPolicy

  • use_custom_feature_extractor

Use Custom Feature Extractor

type

string

enum

resnet18, mobilenet_v2

  • cfe_without_linear

Cfe Without Linear

type

boolean

default

False

  • policy_kwargs

Policy Kwargs

type

object

  • type

Type

type

string

enum

DQN

  • learning_rate

Learning Rate

type

number

default

0.0001

  • buffer_size

Buffer Size

type

integer

default

1000000

  • learning_starts

Learning Starts

type

integer

default

256

  • batch_size

Batch Size

type

integer

default

32

  • tau

Tau

type

number

default

1.0

  • gamma

Gamma

type

number

default

0.99

  • train_freq

Train Freq

type

integer

default

4

  • gradient_steps

Gradient Steps

type

integer

default

1

  • optimize_memory_usage

Optimize Memory Usage

type

boolean

default

False

  • target_update_interval

Target Update Interval

type

integer

default

256

  • exploration_fraction

Exploration Fraction

type

number

default

0.1

  • exploration_initial_eps

Exploration Initial Eps

type

number

default

1.0

  • exploration_final_eps

Exploration Final Eps

type

number

default

0.05

  • max_grad_norm

Max Grad Norm

type

number

default

10

  • seed

Seed

type

integer

  • device

Device

type

string

default

auto

additionalProperties

False

A2CAgent

A2c agent definition.

A2C definition for the stable_baselines3 implementation for this algorithm. Variable comments are taken from the stable_baselines3 documentation.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • tensorboard_log

Tensorboard Log

type

string

  • policy

Policy

type

string

enum

MlpPolicy, CnnPolicy, MultiInputPolicy

  • use_custom_feature_extractor

Use Custom Feature Extractor

type

string

enum

resnet18, mobilenet_v2

  • cfe_without_linear

Cfe Without Linear

type

boolean

default

False

  • policy_kwargs

Policy Kwargs

type

object

  • type

Type

type

string

enum

A2C

  • learning_rate

Learning Rate

type

number

default

0.0007

  • n_steps

N Steps

type

integer

default

5

  • gamma

Gamma

type

number

default

0.99

  • gae_lambda

Gae Lambda

type

number

default

1.0

  • ent_coef

Ent Coef

type

number

default

0.0

  • vf_coef

Vf Coef

type

number

default

0.5

  • seed

Seed

type

integer

  • device

Device

type

string

default

auto

  • max_grad_norm

Max Grad Norm

type

number

default

0.5

  • rms_prop_eps

Rms Prop Eps

type

number

default

1e-05

  • use_rms_prop

Use Rms Prop

type

boolean

default

True

  • use_sde

Use Sde

type

boolean

default

False

  • sde_sample_freq

Sde Sample Freq

type

integer

default

-1

  • normalize_advantage

Normalize Advantage

type

boolean

default

False

additionalProperties

False

MultiProcessing

Define multiprocessing capability of environment.

Defines if the Problem should use Multiprocessing and with how many cores the solver can work. Does not force Multiprocessing for example if the solver does not support it.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • number_of_cores

Number Of Cores

type

integer

minimum

1

default

1

additionalProperties

False

VariableLocation

Variable location class.

Object of this class defines the position and movement possibilities for a single dimensions of a single control point of the geometry.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • current_position

Current Position

type

number

  • min_value

Min Value

type

number

  • max_value

Max Value

type

number

  • n_steps

N Steps

type

integer

minimum

1

default

10

  • step

Step

type

number

additionalProperties

False

ShapeDefinition

Base of shape parameterization, also represents a simple point cloud.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • control_points

Control Points

type

array

items

type

array

items

VariableLocation

additionalProperties

False

SplineSpaceDimension

Defines a single spline space dimension of the current spline.

The dimension is a dimension of the parametric spline dimension.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • name

Name

type

string

  • number_of_points

Number Of Points

type

integer

minimum

1

  • degree

Degree

type

integer

minimum

1

  • knot_vector

Knot Vector

type

array

items

type

number

additionalProperties

False

BSplineDefinition

Definition of the BSpline implementation of the ReLeSO Toolbox.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • control_points

Control Points

type

array

items

type

array

items

VariableLocation

  • space_dimensions

Space Dimensions

type

array

items

SplineSpaceDimension

additionalProperties

False

NURBSDefinition

Definition of a NURBS spline.

Definition of the NURBS implementation of the ReLeSO Toolbox, in comparison to the B-Spline implementation only an additional weights vector is added.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • control_points

Control Points

type

array

items

type

array

items

VariableLocation

  • space_dimensions

Space Dimensions

type

array

items

SplineSpaceDimension

  • weights

Weights

type

array

items

anyOf

type

number

VariableLocation

additionalProperties

False

Geometry

Definition of the Geometry.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • shape_definition

Shape Definition

anyOf

ShapeDefinition

BSplineDefinition

NURBSDefinition

type

array

items

anyOf

ShapeDefinition

BSplineDefinition

NURBSDefinition

  • action_based_observation

Action Based Observation

type

boolean

default

True

  • discrete_actions

Discrete Actions

type

boolean

default

True

  • reset_with_random_action_values

Reset With Random Action Values

type

boolean

default

False

additionalProperties

False

MeshExporter

Class which defines in which format and where the mesh is exported.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • format

Format

type

string

enum

mixd

default

mixd

  • export_path

Export Path

anyOf

type

string

type

string

format

path

additionalProperties

False

MeshIOMesh

Provides an interface to load meshio meshes.

Since gustaf currently only really supports .msh files, this also only supports files with this ending. If and when gustaf implements support for additional files types already supported by meshio. This will be updated.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • path

Path

anyOf

type

string

type

string

format

path

  • export

MeshExporter

  • dimensions

Dimensions

type

integer

minimum

1

additionalProperties

False

MixdMesh

Class used to read in the correct mixd mesh file and load it.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • path

Path

anyOf

type

string

type

string

format

path

  • export

MeshExporter

  • dimensions

Dimensions

type

integer

minimum

1

  • mxyz_path

Mxyz Path

Please use either the path variable xor the mxyz variable, since if used both the used mxyz path might not be the one you think.

type

string

format

file-path

  • mien_path

Mien Path

Please use either the path variable xor the mien variable, since if used both the used mien path might not be the one you think.

type

string

format

file-path

  • hypercube

Hypercube

If True Mesh is made of hypercubes. If False Mesh is made of simplexes (triangles).

type

boolean

default

True

additionalProperties

False

FFDGeometry

FFD based variable shape.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • shape_definition

Shape Definition

anyOf

ShapeDefinition

BSplineDefinition

NURBSDefinition

type

array

items

anyOf

ShapeDefinition

BSplineDefinition

NURBSDefinition

  • action_based_observation

Action Based Observation

type

boolean

default

True

  • discrete_actions

Discrete Actions

type

boolean

default

True

  • reset_with_random_action_values

Reset With Random Action Values

type

boolean

default

False

  • mesh

Mesh

anyOf

MeshIOMesh

MixdMesh

  • export_mesh

MeshExporter

additionalProperties

False

ObservationDefinition

Definition of an Observation.

Definition of a single Observations by providing the name of the value and the range in which the value is limited to.

The range is necessary due to normalization of the input of the agent networks.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • name

Name

type

string

  • value_min

Value Min

type

number

  • value_max

Value Max

type

number

additionalProperties

False

ObservationDefinitionMulti

Define a multidimensional Observations space.

Definition of a single Observations by providing the name of the value and the range in which the value is limited to.

The range is necessary due to normalization of the input of the agent networks.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • name

Name

type

string

  • value_min

Value Min

type

number

  • value_max

Value Max

type

number

  • observation_shape

Observation Shape

type

array

items

type

integer

  • value_type

Value Type

type

string

enum

float, CNN

additionalProperties

False

MultiProcessor

Definition of the utilized multiprocessor. Default MPIEXEC.

The MultiProcessor gives access to command prefixes which can enable parallelization. Currently only tested for MPI.

Note:

The cluster uses PATH variables to correctly call mpi. IF you want to use MPI multiprocessing on the cluster please use ReLeSO.spor.MPIClusterMultiProcessor.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • command

Command

type

string

default

mpiexec -n

  • max_core_count

Max Core Count

type

integer

minimum

1

  • always_use

Always Use

type

boolean

default

False

additionalProperties

False

MPIClusterMultiProcessor

Multi-processor extension for the cluster MPI call.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • command

Command

type

string

default

$MPIEXEC

  • max_core_count

Max Core Count

type

integer

minimum

1

  • always_use

Always Use

type

boolean

default

False

  • location

Location

type

string

enum

cluster

  • mpi_flags_variable

Mpi Flags Variable

type

string

default

$FLAGS_MPI_BATCH

additionalProperties

False

SPORObjectCommandLine

Base definition of a SPORCommandLineObject. Can be instantiated.

Base class for all possible SPOR object classes which use the command line. This class is meant to add some default functionality, so that users do not need to add them themselves. These are:

  1. access to the (MPI) Multi-processors via

    ReLeSO.spor.MultiProcessor

  2. command line command

  3. additional flags

  4. working directory

  5. whether or not to use the

    SPOR Communication Interface

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • name

Name

type

string

  • stop_after_error

Stop After Error

type

boolean

default

True

  • reward_on_error

Reward On Error

type

number

  • reward_on_completion

Reward On Completion

type

number

  • run_on_reset

Run On Reset

type

boolean

default

True

  • additional_observations

Additional Observations

anyOf

ObservationDefinition

ObservationDefinitionMulti

type

array

items

anyOf

ObservationDefinition

ObservationDefinitionMulti

  • multi_processor

Multi Processor

anyOf

MultiProcessor

MPIClusterMultiProcessor

  • use_communication_interface

Use Communication Interface

type

boolean

default

False

  • add_step_information

Add Step Information

type

boolean

default

False

  • working_directory

Working Directory

type

string

  • execution_command

Execution Command

type

string

  • command_options

Command Options

type

array

items

type

string

additionalProperties

False

SPORObjectExternalPythonFunction

Load a python function from an external file.

This class is meant to load a python function from an external file and execute it. The function will be imported in to the package and run in the same python environment as the rest of the package is. If you want to call the function you can use the SPORCommandLineObject.

The function needs to be called main and needs to have the following signature:

args, logger, func_data

Where args are the SPOR COMM arguments, logger is a logger provided by the SPORObject and, func_data is a persistent data variable which is not touched by the SPORObject.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • name

Name

type

string

  • stop_after_error

Stop After Error

type

boolean

default

True

  • reward_on_error

Reward On Error

type

number

  • reward_on_completion

Reward On Completion

type

number

  • run_on_reset

Run On Reset

type

boolean

default

True

  • additional_observations

Additional Observations

anyOf

ObservationDefinition

ObservationDefinitionMulti

type

array

items

anyOf

ObservationDefinition

ObservationDefinitionMulti

  • multi_processor

Multi Processor

anyOf

MultiProcessor

MPIClusterMultiProcessor

  • use_communication_interface

Use Communication Interface

type

boolean

default

False

  • add_step_information

Add Step Information

type

boolean

default

False

  • working_directory

Working Directory

type

string

  • python_file_path

Python File Path

anyOf

type

string

type

string

format

path

additionalProperties

False

SPORObjectInternalPythonFunction

This class will load SPOR functions provided by this package.

Currently available functions are the following:

  • xns_cnn: This function will use the result of the xns solver and

    create an image of the solution. The image is created via contourf.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • name

Name

type

string

  • stop_after_error

Stop After Error

type

boolean

default

True

  • reward_on_error

Reward On Error

type

number

  • reward_on_completion

Reward On Completion

type

number

  • run_on_reset

Run On Reset

type

boolean

default

True

  • additional_observations

Additional Observations

anyOf

ObservationDefinition

ObservationDefinitionMulti

type

array

items

anyOf

ObservationDefinition

ObservationDefinitionMulti

  • multi_processor

Multi Processor

anyOf

MultiProcessor

MPIClusterMultiProcessor

  • use_communication_interface

Use Communication Interface

type

boolean

default

False

  • add_step_information

Add Step Information

type

boolean

default

False

  • working_directory

Working Directory

type

string

  • function_name

Function Name

type

string

enum

xns_cnn

additionalProperties

False

SPORList

The SPORList defines the custom defined steps.

In the current version these steps take place after the FFD is done. These can include the fluid solver, post-processing steps, reward generation, additional logging, etc. In a future version the FFD might be incorporated into a SPOR step to stream line the internal functionality.

If a step sends a stop signal all consecutive steps will be ignored and the Each step can generate observations, rewards and info for the current episode step. These are aggregated as follows.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • steps

Steps

type

array

items

anyOf

SPORObjectCommandLine

SPORObjectExternalPythonFunction

SPORObjectInternalPythonFunction

  • reward_aggregation

Reward Aggregation

type

string

enum

sum, min, max, mean, absmax

additionalProperties

False

Environment

Parser class of which the environment is based.

Parser Environment object is created by pydantic during the parsing of the json object defining the RL based Shape optimization. Each object can create a gym environment that represents the given problem.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • multi_processing

MultiProcessing

  • geometry

Geometry

anyOf

Geometry

FFDGeometry

  • spor

SPORList

  • max_timesteps_in_episode

Max Timesteps In Episode

type

integer

minimum

1

  • end_episode_on_geometry_not_changed

End Episode On Geometry Not Changed

type

boolean

default

False

  • reward_on_geometry_not_changed

Reward On Geometry Not Changed

type

number

  • reward_on_episode_exceeds_max_timesteps

Reward On Episode Exceeds Max Timesteps

type

number

additionalProperties

False

Validation

Parser class to define the validation to be performed during training.

This class is used for the configuration of how validation is to be performed during training.

type

object

properties

  • save_location

Save Location

type

string

format

path

  • logger_name

Logger Name

type

string

  • validation_freq

Validation Freq

type

integer

minimum

1

  • validation_values

Validation Values

type

array

items

type

number

minItems

1

  • save_best_agent

Save Best Agent

type

boolean

  • validate_on_training_end

Validate On Training End

type

boolean

  • max_timesteps_in_episode

Max Timesteps In Episode

type

integer

minimum

1

  • end_episode_on_geometry_not_changed

End Episode On Geometry Not Changed

type

boolean

default

False

  • reward_on_geometry_not_changed

Reward On Geometry Not Changed

type

number

  • reward_on_episode_exceeds_max_timesteps

Reward On Episode Exceeds Max Timesteps

type

number

additionalProperties

False