4using System.Collections.Generic;
8using System.Threading.Tasks;
19 double m_dfReward = 0;
20 int m_nActionCount = 0;
24 double[] m_rgState =
null;
25 double[] m_rgClip =
null;
27 double m_dfTestingPercent = 0.2;
28 List<DataPoint> m_rgHistory =
null;
35 m_nActionCount = nActionCount;
46 get {
return m_dfTestingPercent; }
47 set { m_dfTestingPercent = value; }
55 get {
return m_bValid; }
56 set { m_bValid = value; }
64 get {
return m_dfReward; }
65 set { m_dfReward = value; }
73 get {
return m_bDone; }
74 set { m_bDone = value; }
82 get {
return m_rgHistory; }
83 set { m_rgHistory = value; }
91 get {
return m_nActionCount; }
99 get {
return m_data; }
100 set { m_data = value; }
108 get {
return m_rgState; }
109 set { m_rgState = value; }
117 get {
return m_clip; }
118 set { m_clip = value; }
126 get {
return m_rgClip; }
127 set { m_rgClip = value; }
135 get {
return m_label; }
136 set { m_label = value; }
144 get {
return m_img; }
145 set { m_img = value; }
157 s.m_bValid = m_bValid;
158 s.m_dfReward = m_dfReward;
160 s.m_rgState =
Utility.Clone<
double>(m_rgState);
165 s.m_img = (m_img ==
null) ?
null :
new Bitmap(m_img);
176 double[] rgData = m_data.GetData<
double>();
179 for (
int i = 0; i < rgData.Length && i < 5; i++)
181 str += rgData[i].
ToString(
"N4") +
",";
183 str = str.TrimEnd(
',');
186 return "State = " + str +
" Done = " + m_bDone.ToString();
The SimpleDatum class holds a data input within host memory.
override string ToString()
Return a string representation of the SimpleDatum.
The Utility class provides general utility funtions.
The StateBase is the base class for the state of each observation - this is defined by actual trainer...
bool IsValid
Get/set whether or not the state is valid.
bool Done
Get/set whether the state is done or not.
StateBase(int nActionCount)
The constructor.
virtual StateBase Clone()
Copy the state base information.
override string ToString()
Return the string representation of the state.
double Reward
Get/set the reward of the state.
double[] RawState
Get/set the raw state data.
SimpleDatum Label
Get/set the label data associated with the state. This field is optional.
double TestingPercent
Get/set the percentage of the data to reserve for testing.
List< DataPoint > History
Get/set the data history (if any exists).
SimpleDatum Data
Returns other data associated with the state.
double[] RawClip
Get/set the raw clip data.
Image RawImage
Get/set the image (if any exists)
int ActionCount
Returns the number of actions.
SimpleDatum Clip
Returns the clip data assoicated with the state.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.gym namespace contains all classes related to the Gym's supported by MyCaffe.
The MyCaffe.trainers namespace contains all reinforcement and recurrent learning trainers.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...