-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High-level API: Establish a strong link between the actor and the distribution function #1195
Conversation
d97f7d3
to
ae726fd
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1195 +/- ##
==========================================
+ Coverage 84.74% 84.77% +0.02%
==========================================
Files 104 104
Lines 8974 8983 +9
==========================================
+ Hits 7605 7615 +10
+ Misses 1369 1368 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, only minor comments.
Unrelated comment: At some point soon we should add more exhaustive documentation of the ideas behind HL interfaces - I have a hard time understanding why AgentFuture would be needed from a glance at it (I could search in the IDE, ofc, and would eventually understand it, but we should try to reduce the cognitive load)
ae726fd
to
c81a386
Compare
Sure, we can add more information where it helps. My general documentation principle is to document what things are, not how they are used, because the former is invariant/universal while the latter is just a momentary snapshop (and could potentially change in the future). It's usually fine (for me) to search for usages to find out how something is being used. To reveal: ActorFuture is necessary to support the concept of critics reusing the actor network. When the user declares that he wants to reuse the actor for the critic, I have to create a critic factory that does this, but the actor does not exist yet. So the critic factory instead receives the future, which will eventually be filled when the actor factory is called. When the critic factory is itself called, it can use the then-filled actor to create the critic. |
distribution function (dist_fn) used in policies by creating the distribution function in the actor factory which knows which function is appropriate. Consequently, remove the policy parameter 'dist_fn' from the high-level API because it is determined automatically, eliminating the possibility of misspecification by the user. [breaking change: code must not specify the 'dist_fn' parameter, but persisted objects continue to work as expected] Implements #1194
c81a386
to
ee90cb5
Compare
7f1e1a8
to
8114dd1
Compare
Would it make sense to leave the user the option of providing a custom dist_fn optionally? Then of course they need to know what they are doing. I can't think of a practical example right now, but who knows? |
@maxhuettenrauch it is still possible to modify the distribution function, simply by using your own (subclassed) ActorFactory which can override the creation method to return whatever you want. So only the mechanism changed... |
Establish a strong link between the actor and the distribution function (dist_fn) used in policies by creating the distribution function in the actor factory which knows which function is appropriate.
Consequently, remove the policy parameter 'dist_fn' from the high-level API because it is determined automatically, eliminating the possibility of misspecification by the user. [breaking change: code must not specify the 'dist_fn' parameter, but persisted objects continue to work as expected]
Implements #1194
poe format
poe lint
andpoe type-check
poe test
(or a subset of them with
poe test-reduced
) ,and they passpoe doc-build