[PATCH] D89626: [ML] Add final reward logging facility.

Yundi Qian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 18 22:10:46 PDT 2020


yundiqian requested changes to this revision.
yundiqian added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/include/llvm/Analysis/Utils/TFUtils.h:142-145
+  template <typename T> void logFinalReward(T Value) {
+    assert(RawLogData.back().empty());
+    logReward(Value);
+  }
----------------
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:
1. logReward(0) in each step
2. have a function in Logger called logFinalReward(T value) or overwriteFinalReward(T value), which overwrites the value in RawLogData.back()->back()

or:
1. don't logReward(0) in each step
2. have a function in Logger called logFinalReward(T value) that fills in 0 in RawLogData.back() except putting reward in the last, we can tell the length by looking at feature length already logged in RawLogData


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89626/new/

https://reviews.llvm.org/D89626



More information about the llvm-commits mailing list