Skip to content

[rllib] Misc rllib changes#2224

Closed
alok wants to merge 11 commits intoray-project:masterfrom
alok:misc-rllib
Closed

[rllib] Misc rllib changes#2224
alok wants to merge 11 commits intoray-project:masterfrom
alok:misc-rllib

Conversation

@alok
Copy link
Contributor

@alok alok commented Jun 9, 2018

What do these changes do?

Small followup to #2149.

Mostly cleans up random little things.

@ericl please check this out. I broke it into separate commits to make reverting
each part easier.

Related issue number

#2149.

alok added 11 commits June 9, 2018 01:30
This is meant for an RNN and hidden state is the standard terminology, plus
`state` generally has a very different meaning in an RL library.
`self.sess` isn't defined, and all the other methods call `self._sess`
rm ugly backslash by using the fact that a function that returns multiple
values actually returns a tuple.
The only real time this file is modified is to add/rm from one of those lists,
so we may as well make the diff easy by putting every element on its own line.
`tf.{add,square,multiply,abs}` all have overloaded operators.

`0.5 * foo` is easier to read in almost all cases as `foo / 2`.
Rollout should have .items() implemented, which makes this easier to read.
It's a short function and may as well be made even easier to read.
`exp_vals` sounds like it has to do with the exponential function.

Since it's only used in this one spot, may as well be explicit since it doesn't
really cost much brevity.
@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/5963/
Test FAILed.

@ericl
Copy link
Contributor

ericl commented Jun 9, 2018

@alok, while cleaning up code as you add features is always appreciated, there is little value in changing things for the sake of changing them.

I'm closing this since most of the changes seem superficial and a matter of opinion as to whether they are better or worse. I am planning on linting all of rllib at some point when convenient though -- so no need to worry about that ;)

@ericl ericl closed this Jun 9, 2018
@alok
Copy link
Contributor Author

alok commented Jun 9, 2018 via email

@ericl
Copy link
Contributor

ericl commented Jun 9, 2018 via email

@alok
Copy link
Contributor Author

alok commented Jun 10, 2018

If every subclass ends up setting self.sess, is it worth it to have both self.sess and self._sess if they end up doing what's apparently the same thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants