Skip to content

Commit 71c3bc0

Browse files
committed
Merge branch 'release/pypipub'
2 parents 2abcdbe + de07b63 commit 71c3bc0

File tree

6 files changed

+86
-7
lines changed

6 files changed

+86
-7
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
#on:
6+
#push:
7+
#branches: [master]
8+
9+
jobs:
10+
build-n-publish:
11+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
12+
runs-on: ubuntu-18.04
13+
steps:
14+
- uses: actions/checkout@master
15+
- name: Set up Python 3.7
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.7
19+
- name: Install pep517
20+
run: >-
21+
python -m
22+
pip install
23+
pep517
24+
--user
25+
- name: Build a binary wheel and a source tarball
26+
run: >-
27+
python -m
28+
pep517.build
29+
--source
30+
--binary
31+
--out-dir dist/
32+
.
33+
- name: Publish distribution 📦 to Test PyPI
34+
if: endsWith(github.ref, 'master')
35+
uses: pypa/gh-action-pypi-publish@master
36+
with:
37+
password: ${{ secrets.test_pypi_password }}
38+
repository_url: https://test.pypi.org/legacy/
39+
- name: Publish distribution 📦 to PyPI
40+
if: startsWith(github.ref, 'refs/tags')
41+
uses: pypa/gh-action-pypi-publish@master
42+
with:
43+
password: ${{ secrets.pypi_password }}
44+
#verbose: true
45+
#skip_existing: true

neodroidagent/utilities/exploration/intrinsic_signals/torch_isp/curiosity/icm.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def __init__(
124124
signal_space: SignalSpace,
125125
policy_weight: float,
126126
weight: float,
127-
intrinsic_reward_integration: float,
127+
intrinsic_signal_factor: float,
128128
hidden_dim: int = 128,
129129
):
130130
"""
@@ -134,7 +134,7 @@ def __init__(
134134
:param signal_space: used for scaling the intrinsic reward returned by this module. Can be used to control how
135135
the fluctuation scale of the intrinsic signal
136136
:param weight: balances the importance between forward and inverse model
137-
:param intrinsic_reward_integration: balances the importance between extrinsic and intrinsic signal.
137+
:param intrinsic_signal_factor: balances the importance between extrinsic and intrinsic signal.
138138
"""
139139

140140
assert (
@@ -148,7 +148,7 @@ def __init__(
148148
self.policy_weight = policy_weight
149149
self.reward_scale = signal_space.span
150150
self.weight = weight
151-
self.intrinsic_signal_integration = intrinsic_reward_integration
151+
self.intrinsic_signal_factor = intrinsic_signal_factor
152152

153153
self.encoder = nn.Sequential(
154154
nn.Linear(observation_space.shape[0], hidden_dim),
@@ -233,8 +233,8 @@ def sample(
233233
writer.scalar("icm/signal", intrinsic_signal.mean().item())
234234

235235
return (
236-
1.0 - self.intrinsic_signal_integration
237-
) * signals + self.intrinsic_signal_integration * intrinsic_signal
236+
1.0 - self.intrinsic_signal_factor
237+
) * signals + self.intrinsic_signal_factor * intrinsic_signal
238238

239239
def loss(
240240
self,

neodroidagent/utilities/transformation/processing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@ def gray_downscale(state, configuration):
9595
downsized_img = transform.resize(gray_img, (84, 84), mode="constant")
9696
state = torch.from_numpy(downsized_img).type(StateTensorType) # 2D image tensor
9797
return torch.stack([state], 0).unsqueeze(0)
98+
99+
if __name__ == '__main__':
100+
gray_downscale()

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
devpack
2-
gym
32
Neodroid
43
trolls
54
numpy
@@ -18,3 +17,5 @@ pip
1817
scipy
1918
numba
2019
tensorboard
20+
#pybullet
21+
#gym

samples/experimental/grasping.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
4+
__author__ = 'Christian Heider Nielsen'
5+
__doc__ = r'''
6+
7+
Created on 19-10-2020
8+
'''
9+
10+
if __name__ == '__main__':
11+
12+
13+
def main():
14+
from pybullet_envs.bullet.kuka_diverse_object_gym_env import ( KukaDiverseObjectEnv )
15+
16+
env = KukaDiverseObjectEnv(
17+
isDiscrete=True,
18+
renders=True,
19+
height=84,
20+
width=84,
21+
maxSteps=2000,
22+
isTest=True,
23+
)
24+
# Disable file caching to keep memory usage small
25+
env._p.setPhysicsEngineParameter(enableFileCaching=False)
26+
27+
main()

tests/test_sanity.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
import pytest
66

77
__author__ = "Christian Heider Nielsen"
8+
__doc__ = r"""
89
10+
Created on 01/08/2020
11+
"""
912

1013
def test_sanity():
1114
assert True
@@ -21,7 +24,7 @@ def test_print(capsys):
2124
print(text)
2225
sys.stderr.write("world")
2326
captured = capsys.readouterr()
24-
assert text in captured.head
27+
assert text in captured.out
2528
assert err in captured.err
2629

2730

0 commit comments

Comments
 (0)