DQN class

DQN wrapper with optional target network and configurable replay buffer

Enhancements:

  • optional target network with periodic hard updates
  • configurable discount (gamma) and batch size
  • simple (FIFO) replay buffer with capacity
  • serialization to/from Map/JSON

Constructors

DQN({required int nActions, required List<int> netLayers, int memoryCapacity = 1000, double epsilon = 0.1, double gamma = 0.99, int targetUpdateSteps = 100, bool useTarget = true, int? seed})

Properties

epsilon double
getter/setter pair
gamma double
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
memoryCapacity int
final
nActions int
final
network ANN
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
targetUpdateSteps int
final

Methods

chooseAction(List<double> state) int
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remember(List<double> state, int action, double reward, List<double> nextState) → void
replay({int batchSize = 16}) → void
toJson() String
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromJson(String s, {int? seed}) DQN
fromMap(Map<String, dynamic> m, {int? seed}) DQN