NoJobEngine 2.0.7
Loading...
Searching...
No Matches
NoJob::NeuralAgent Namespace Reference

Classes

struct  Snapshot
 A copy of neural agent inference state for editor diagnostics. More...

Enumerations

enum class  TrainingPreset { FollowXZ = 0 , TrackY = 1 , Pong = 2 }
 Supported supervised training datasets and target mappings. More...

Functions

std::mutex & Mutex ()
std::unordered_map< unsigned int, Snapshot > & Snapshots ()
void Publish (unsigned int entity, Snapshot snapshot)
 Publishes an entity snapshot for live AI debugging.
bool Read (unsigned int entity, Snapshot &out)
 Copies the latest snapshot, if one exists for the entity.
void Clear (unsigned int entity)
 Removes diagnostics when an agent is destroyed or reset.
std::vector< std::vector< float > > Activations (const Neural::NeuralNetwork &net, const std::vector< float > &input)
const char * PresetLabel (TrainingPreset p)
Neural::TrainingHistory TrainPreset (const std::string &outputName, const std::string &sourceName, TrainingPreset preset, int epochs, float learningRate, bool resume, bool overwrite)
 Trains a preset model and saves it independently of the active model.
Neural::TrainingHistory TrainDirectionModel (const std::string &name, int epochs, float learningRate, bool resume=false, bool overwrite=false)

Enumeration Type Documentation

◆ TrainingPreset

Supported supervised training datasets and target mappings.

Enumerator
FollowXZ 
TrackY 
Pong 

Definition at line 51 of file NeuralAgentTraining.h.

Function Documentation

◆ Activations()

std::vector< std::vector< float > > NoJob::NeuralAgent::Activations ( const Neural::NeuralNetwork & net,
const std::vector< float > & input )
inline

◆ Clear()

void NoJob::NeuralAgent::Clear ( unsigned int entity)
inline

◆ Mutex()

std::mutex & NoJob::NeuralAgent::Mutex ( )
inline

Definition at line 26 of file NeuralAgentTraining.h.

References Mutex().

Referenced by Clear(), Mutex(), Publish(), and Read().

◆ PresetLabel()

const char * NoJob::NeuralAgent::PresetLabel ( TrainingPreset p)
inline

Definition at line 52 of file NeuralAgentTraining.h.

References FollowXZ, PresetLabel(), and TrackY.

Referenced by PresetLabel().

◆ Publish()

void NoJob::NeuralAgent::Publish ( unsigned int entity,
Snapshot snapshot )
inline

Publishes an entity snapshot for live AI debugging.

Definition at line 29 of file NeuralAgentTraining.h.

References Mutex(), Publish(), and Snapshots().

Referenced by NoJob::BTAssetAgent::CreateTree(), NoJob::GenericNeuralAgent::OnUpdate(), NoJob::NeuralTrainingAgent::OnUpdate(), and Publish().

◆ Read()

bool NoJob::NeuralAgent::Read ( unsigned int entity,
Snapshot & out )
inline

Copies the latest snapshot, if one exists for the entity.

Definition at line 31 of file NeuralAgentTraining.h.

References Mutex(), Read(), and Snapshots().

Referenced by Read().

◆ Snapshots()

std::unordered_map< unsigned int, Snapshot > & NoJob::NeuralAgent::Snapshots ( )
inline

Definition at line 27 of file NeuralAgentTraining.h.

References Snapshots().

Referenced by Clear(), Publish(), Read(), and Snapshots().

◆ TrainDirectionModel()

Neural::TrainingHistory NoJob::NeuralAgent::TrainDirectionModel ( const std::string & name,
int epochs,
float learningRate,
bool resume = false,
bool overwrite = false )
inline

Definition at line 136 of file NeuralAgentTraining.h.

References FollowXZ, TrainDirectionModel(), and TrainPreset().

Referenced by TrainDirectionModel().

◆ TrainPreset()

Neural::TrainingHistory NoJob::NeuralAgent::TrainPreset ( const std::string & outputName,
const std::string & sourceName,
TrainingPreset preset,
int epochs,
float learningRate,
bool resume,
bool overwrite )
inline

Trains a preset model and saves it independently of the active model.

Parameters
outputNameDestination asset name.
sourceNameSource model name when resuming.
presetSupervised training task.
epochsRequested epoch count (clamped internally).
learningRateOptimizer step size (clamped internally).
resumeWhether to load weights from sourceName.
overwriteWhether an existing output may be replaced.
Returns
Loss history for the training run.

Definition at line 66 of file NeuralAgentTraining.h.

References NoJob::Neural::TrainingOptions::adam, NoJob::Neural::NeuralNetwork::AddDense(), NoJob::Neural::TrainingOptions::batchSize, NoJob::Neural::TrainingOptions::epochs, FollowXZ, NoJob::Neural::NeuralNetwork::Layers(), NoJob::Neural::TrainingOptions::learningRate, NoJob::Neural::NeuralNetwork::Load(), NoJob::NeuralAssetPath(), NoJob::Neural::NeuralNetwork::Save(), NoJob::Neural::TrainingOptions::seed, NoJob::Neural::Tanh, TrackY, NoJob::Neural::NeuralNetwork::Train(), and TrainPreset().

Referenced by NoJob::NeuralTrainingAgent::OnCreate(), TrainDirectionModel(), and TrainPreset().