Skip to content

Commit

Permalink
Remove training
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekim committed Nov 23, 2023
1 parent 1519613 commit 1558b39
Showing 1 changed file with 0 additions and 124 deletions.
124 changes: 0 additions & 124 deletions spiceaidocs/content/en/reference/Spicepod/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -731,127 +731,3 @@ dataspaces:
if args.position > 10:
game.character.coins += 1
```

## `training`

**Required**. Controls the training process for Spice.ai.

**Example**

```yaml
training:
rewards:
- reward: buy
with: reward = 1
- reward: sell
with: reward = 1
- reward: hold
with: reward = 1
```

### `training.goal`

End the training early if Spice.ai reaches a training goal three times in a row.

After a single episode is completed from a training run, a `score` is kept of the cumulative rewards that the Spice.ai runtime received. Use the `goal` here to write a python expression to check if the training goal has been met.

**Example**

```yaml
training:
goal: score >= 100
```

### `training.loggers`

A list of training loggers to enable for each pod training run.

Supported loggers and their values are:

| Logger | Value |
| ------------------------------------------------------ | ------------- |
| [TensorBoard](https://www.tensorflow.org/tensorboard/) | `tensorboard` |

**_Example_**

```yaml
training:
loggers:
- tensorboard
```

### `training.reward_init`

A python code block that will be run before an action specific reward code block runs. Use this to define common variables that will be useful to reference in the specific reward code blocks.

**Example**

```yaml
training:
reward_init: |
# Compute price change between previous state and this one
# so it can be used in all three reward functions
prev_price = current_state["coinbase_btcusd_close"]
new_price = next_state["coinbase_btcusd_close"]
change_in_price = new_price - prev_price
rewards:
- reward: buy
with: reward = -change_in_price
- reward: sell
with: reward = change_in_price
- reward: hold
with: |
if change_in_price > 0:
reward = -0.1
else:
reward = 0.1
```

### `training.reward_funcs`

The path to a Python file that defines the reward functions to use, instead of python code blocks.

### `training.rewards`

**Required**. Defines how to reward the Spice.ai runtime during training so that it learns to take more intelligent actions.

This can be a list of reward definitions or the string "uniform" to indicate that all rewards should receive the same reward.

**Example**

```yaml
training:
rewards: uniform
```

```yaml
training:
rewards:
- reward: buy
with: reward = 1
- reward: sell
with: reward = 1
```

### `training.rewards[*].reward`

The name of the action to associate this reward function with. Should be the same name as an action defined in [actions](#actions)

```yaml
actions:
- name: jump
training:
rewards:
- reward: jump
with: reward = 1
```

### `training.rewards[*].with`

If `training.reward_funcs` is defined, then this should be the name of the function defined in the python file to use for specifying which reward to give the Spice.ai agent for taking this action.

If `training.reward_funcs` is not defined, then this is a python code block that needs to assign a variable to `reward` to specify which reward to give the Spice.ai agent for taking this action.

See [Rewards]({{<ref "concepts/rewards">}}) for more information on how to define reward functions.

0 comments on commit 1558b39

Please sign in to comment.