{Train}=require('flatnet')
Simple training function: Evaluate, Fitness, Save?, End?, Cycle, repeat
Train(net,data=[],targets=[],config=CONFIG)dataarray:- Elements in the array can be any variable, they will be Flattened
- Each element should contain all the inputs for a single step evaluation
targetsarray:- Elements in the array can be any variable
- Elements are passed to the user supplied Fitness function
configobject:name- The name used for file saving and loading
- Default
name = 'model'
keep_ratio- The % of models that will survive removal, see Network.Cycle
- Default
keep_ratio = 0.25
mut_count- The number of times the model is mutated, see Network.Mutate
- Default
mut_count = 3
mut_ratio- The pivot point for deleting or adding actions in mutation, see Network.Mutate
- Default
mut_ratio = 0.4
logging- Console.log information during training
- Default
logging = false
Fitness- The fitness function used after evaluation
- Default
Fitness = Network._STDFITNESS, see Network._STDFITNESS
Save- This function is called after Eval & Fitness have completed, and before
EndandCycle - To initiate a map save, must return a valid index position of a model in
net.models[] - See Model.SaveMap
- Default
save:Save:func=(net)=>{ if(func.last>=net.scores.high)return; func.last=net.scores.high; return net.scores.h; }
- This function is called after Eval & Fitness have completed, and before
End- The function to determine end of training
- Is called after
Saveand beforeCycle - Return ===
trueto end - Default
End = (net)=>false(infinite)