Allow logging final rewards. A final reward is logged only once, and is
serialized as all-zero values, except for the last one.
Details
- Reviewers
yundiqian ebrevdo gjain - Commits
- rGd454328ea885: [ML] Add final reward logging facility.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/Analysis/Utils/TFUtils.h | ||
---|---|---|
142–145 | It seems over-complicated to pass the flag FinalReward to writeRawTensorsAsFeatureLists function and treat the case separately. How about making the RawLogData ready-to-print (reward vector is <0, 0, ..., 0, reward>) so that we don't need to change writeRawTensorsAsFeatureLists function? basically the user is supposed to make sure the data in RawLogData is ready-to-print and writeRawTensorsAsFeatureLists only takes care of printing format. We can either:
or:
|
llvm/include/llvm/Analysis/Utils/TFUtils.h | ||
---|---|---|
142–145 | That would mean keeping around a potentially large array containing 0 (except the last value). I would rather not add memory overhead if it can be avoided, and the extra consideration in code isn't that hard to grok. |
llvm/include/llvm/Analysis/Utils/TFUtils.h | ||
---|---|---|
142–145 | Since it's for development mode, I guess it is debatable whether it worth adding code complexity to trade for better efficiency. imo it does not worth it, but I'm open to either options. |
It seems over-complicated to pass the flag FinalReward to writeRawTensorsAsFeatureLists function and treat the case separately.
How about making the RawLogData ready-to-print (reward vector is <0, 0, ..., 0, reward>) so that we don't need to change writeRawTensorsAsFeatureLists function? basically the user is supposed to make sure the data in RawLogData is ready-to-print and writeRawTensorsAsFeatureLists only takes care of printing format.
We can either:
or: