Skip to content
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

Precompute log probability in PPO #430

Merged
merged 6 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion chainerrl/initializers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
from chainerrl.initializers.constant import VarianceScalingConstant # NOQA
from chainerrl.initializers.normal import LeCunNormal # NOQA

# LeCunNormal was merged into Chainer v3, thus removed from ChainerRL.
# For backward compatibility, it is still imported in this namespace.
from chainer.initializers import LeCunNormal # NOQA
13 changes: 0 additions & 13 deletions chainerrl/initializers/normal.py

This file was deleted.

3 changes: 1 addition & 2 deletions chainerrl/links/mlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@

import chainer
from chainer import functions as F
from chainer.initializers import LeCunNormal
from chainer import links as L

from chainerrl.initializers import LeCunNormal


class MLP(chainer.Chain):
"""Multi-Layer Perceptron"""
Expand Down
3 changes: 1 addition & 2 deletions chainerrl/links/mlp_bn.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@

import chainer
from chainer import functions as F
from chainer.initializers import LeCunNormal
from chainer import links as L

from chainerrl.initializers import LeCunNormal


class LinearBN(chainer.Chain):
"""Linear layer with BatchNormalization."""
Expand Down
2 changes: 1 addition & 1 deletion chainerrl/policies/deterministic_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

import chainer
from chainer import functions as F
from chainer.initializers import LeCunNormal
from chainer import links as L

from chainerrl import distribution
from chainerrl.functions.bound_by_tanh import bound_by_tanh
from chainerrl.initializers import LeCunNormal
from chainerrl.links.mlp import MLP
from chainerrl.links.mlp_bn import MLPBN
from chainerrl.policy import Policy
Expand Down
2 changes: 1 addition & 1 deletion chainerrl/policies/gaussian_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

import chainer
from chainer import functions as F
from chainer.initializers import LeCunNormal
from chainer import links as L
import numpy as np

from chainerrl import distribution
from chainerrl.functions.bound_by_tanh import bound_by_tanh
from chainerrl.initializers import LeCunNormal
from chainerrl import links
from chainerrl.policy import Policy

Expand Down
2 changes: 1 addition & 1 deletion chainerrl/q_functions/state_action_q_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import chainer
from chainer import functions as F
from chainer.initializers import LeCunNormal
from chainer import links as L

from chainerrl.initializers import LeCunNormal
from chainerrl.links.mlp import MLP
from chainerrl.links.mlp_bn import MLPBN
from chainerrl.q_function import StateActionQFunction
Expand Down
5 changes: 3 additions & 2 deletions examples/ale/train_a3c_ale.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ def main():
logging.basicConfig(level=args.logging_level)

# Set a random seed used in ChainerRL.
# If you use more than one processes, the results will be no longer
# deterministic even with the same random seed.
# If you use more than one process (i.e. processes > 1),
# the results will be no longer be deterministic
# even with the same random seed.
misc.set_random_seed(args.seed)

# Set different random seeds for different subprocesses.
Expand Down
2 changes: 1 addition & 1 deletion examples/gym/train_acer_gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import chainer
from chainer import functions as F
from chainer.initializers import LeCunNormal
from chainer import links as L
import gym
from gym import spaces
Expand All @@ -24,7 +25,6 @@
from chainerrl.agents import acer
from chainerrl.distribution import SoftmaxDistribution
from chainerrl import experiments
from chainerrl.initializers import LeCunNormal
from chainerrl import links
from chainerrl import misc
from chainerrl.optimizers import rmsprop_async
Expand Down