Skip to content

Commit eb4b1e5

Browse files
committed
Initial ARM and C2F-ARM.
0 parents  commit eb4b1e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+5392
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
__pycache__
2+
venv
3+
.idea
4+
.bash_history
5+
.cache/
6+
.local/
7+
.python_history
8+
nvidia-persistenced/
9+
results/
10+
rlight.egg-info

LICENSE

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
Q-attention: Enabling Efficient Learning for Vision-based Robotic Manipulation
2+
3+
LICENCE AGREEMENT
4+
5+
WE (Imperial College of Science, Technology and Medicine, (“Imperial College London”))
6+
ARE WILLING TO LICENSE THIS SOFTWARE TO YOU (a licensee “You”) ONLY ON THE
7+
CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THE
8+
FOLLOWING AGREEMENT. PLEASE READ THE AGREEMENT CAREFULLY BEFORE
9+
DOWNLOADING THE SOFTWARE. BY EXERCISING THE OPTION TO DOWNLOAD
10+
THE SOFTWARE YOU AGREE TO BE BOUND BY THE TERMS OF THE AGREEMENT.
11+
SOFTWARE LICENCE AGREEMENT (EXCLUDING BSD COMPONENTS)
12+
13+
1.This Agreement pertains to a worldwide, non-exclusive, temporary, fully paid-up, royalty
14+
free, non-transferable, non-sub- licensable licence (the “Licence”) to use the Q-attention
15+
source code, including any modification, part or derivative (the “Software”).
16+
Ownership and Licence. Your rights to use and download the Software onto your computer,
17+
and all other copies that You are authorised to make, are specified in this Agreement.
18+
However, we (or our licensors) retain all rights, including but not limited to all copyright and
19+
other intellectual property rights anywhere in the world, in the Software not expressly
20+
granted to You in this Agreement.
21+
22+
2. Permitted use of the Licence:
23+
24+
(a) You may download and install the Software onto one computer or server for use in
25+
accordance with Clause 2(b) of this Agreement provided that You ensure that the Software is
26+
not accessible by other users unless they have themselves accepted the terms of this licence
27+
agreement.
28+
29+
(b) You may use the Software solely for non-commercial, internal or academic research
30+
purposes and only in accordance with the terms of this Agreement. You may not use the
31+
Software for commercial purposes, including but not limited to (1) integration of all or part of
32+
the source code or the Software into a product for sale or licence by or on behalf of You to
33+
third parties or (2) use of the Software or any derivative of it for research to develop software
34+
products for sale or licence to a third party or (3) use of the Software or any derivative of it
35+
for research to develop non-software products for sale or licence to a third party, or (4) use of
36+
the Software to provide any service to an external organisation for which payment is
37+
received.
38+
39+
Should You wish to use the Software for commercial purposes, You shall
40+
41+
42+
(c) Right to Copy. You may copy the Software for back-up and archival purposes, provided
43+
that each copy is kept in your possession and provided You reproduce our copyright notice
44+
(set out in Schedule 1) on each copy.
45+
46+
(d) Transfer and sub-licensing. You may not rent, lend, or lease the Software and You may
47+
not transmit, transfer or sub-license this licence to use the Software or any of your rights or
48+
obligations under this Agreement to another party.
49+
50+
(e) Identity of Licensee. The licence granted herein is personal to You. You shall not permit
51+
any third party to access, modify or otherwise use the Software nor shall You access modify
52+
or otherwise use the Software on behalf of any third party. If You wish to obtain a licence for
53+
mutiple users or a site licence for the Software please contact us
54+
55+
56+
(f) Publications and presentations. You may make public, results or data obtained from,
57+
dependent on or arising from research carried out using the Software, provided that any such
58+
presentation or publication identifies the Software as the source of the results or the data,
59+
including the Copyright Notice given in each element of the Software, and stating that the
60+
Software has been made available for use by You under licence from Imperial College London
61+
and You provide a copy of any such publication to Imperial College London.
62+
63+
3. Prohibited Uses. You may not, without written permission from us
64+
65+
66+
(a) Use, copy, modify, merge, or transfer copies of the Software or any documentation
67+
provided by us which relates to the Software except as provided in this Agreement;
68+
69+
(b) Use any back-up or archival copies of the Software (or allow anyone else to use such
70+
copies) for any purpose other than to replace the original copy in the event it is destroyed or
71+
becomes defective; or
72+
73+
(c) Disassemble, decompile or "unlock", reverse translate, or in any manner decode the
74+
Software for any reason.
75+
76+
4. Warranty Disclaimer
77+
78+
(a) Disclaimer. The Software has been developed for research purposes only. You
79+
acknowledge that we are providing the Software to You under this licence agreement free of
80+
charge and on condition that the disclaimer set out below shall apply. We do not represent or
81+
warrant that the Software as to: (i) the quality, accuracy or reliability of the Software; (ii) the
82+
suitability of the Software for any particular use or for use under any specific conditions; and
83+
(iii) whether use of the Software will infringe third-party rights.
84+
You acknowledge that You have reviewed and evaluated the Software to determine that it
85+
meets your needs and that You assume all responsibility and liability for determining the
86+
suitability of the Software as fit for your particular purposes and requirements. Subject to
87+
Clause 4(b), we exclude and expressly disclaim all express and implied representations,
88+
warranties, conditions and terms not stated herein (including the implied conditions or
89+
warranties of satisfactory quality, merchantable quality, merchantability and fitness for
90+
purpose).
91+
92+
(b) Savings. Some jurisdictions may imply warranties, conditions or terms or impose
93+
obligations upon us which cannot, in whole or in part, be excluded, restricted or modified or
94+
otherwise do not allow the exclusion of implied warranties, conditions or terms, in which
95+
case the above warranty disclaimer and exclusion will only apply to You to the extent
96+
permitted in the relevant jurisdiction and does not in any event exclude any implied
97+
warranties, conditions or terms which may not under applicable law be excluded.
98+
99+
(c) Imperial College London disclaims all responsibility for the use which is made of the
100+
Software and any liability for the outcomes arising from using the Software.
101+
102+
5. Limitation of Liability
103+
104+
(a) You acknowledge that we are providing the Software to You under this licence agreement
105+
free of charge and on condition that the limitation of liability set out below shall apply.
106+
Accordingly, subject to Clause 5(b), we exclude all liability whether in contract, tort,
107+
negligence or otherwise, in respect of the Software and/or any related documentation
108+
provided to You by us including, but not limited to, liability for loss or corruption of data,
109+
loss of contracts, loss of income, loss of profits, loss of cover and any consequential or indirect
110+
loss or damage of any kind arising out of or in connection with this licence agreement,
111+
however caused. This exclusion shall apply even if we have been advised of the possibility of
112+
such loss or damage.
113+
114+
(b) You agree to indemnify Imperial College London and hold it harmless from and against
115+
any and all claims, damages and liabilities asserted by third parties (including claims for
116+
negligence) which arise directly or indirectly from the use of the Software or any derivative
117+
of it or the sale of any products based on the Software. You undertake to make no liability
118+
claim against any employee, student, agent or appointee of Imperial College London, in
119+
connection with this Licence or the Software.
120+
121+
(c) Nothing in this Agreement shall have the effect of excluding or limiting our statutory
122+
liability.
123+
124+
(d) Some jurisdictions do not allow these limitations or exclusions either wholly or in part,
125+
and, to that extent, they may not apply to you. Nothing in this licence agreement will affect
126+
your statutory rights or other relevant statutory provisions which cannot be excluded,
127+
restricted or modified, and its terms and conditions must be read and construed subject to any
128+
such statutory rights and/or provisions.
129+
130+
6. Confidentiality. You agree not to disclose any confidential information provided to You by
131+
us pursuant to this Agreement to any third party without our prior written consent. The
132+
obligations in this Clause 6 shall survive the termination of this Agreement for any reason.
133+
134+
7. Termination.
135+
136+
(a) We may terminate this licence agreement and your right to use the Software at any time
137+
with immediate effect upon written notice to You.
138+
139+
(b) This licence agreement and your right to use the Software automatically terminate if You:
140+
(i) fail to comply with any provisions of this Agreement; or
141+
(ii) destroy the copies of the Software in your possession, or voluntarily return the Software
142+
to us.
143+
144+
(c) Upon termination You will destroy all copies of the Software.
145+
146+
(d) Otherwise, the restrictions on your rights to use the Software will expire 10 (ten) years
147+
after first use of the Software under this licence agreement.
148+
149+
8. Miscellaneous Provisions.
150+
151+
(a) This Agreement will be governed by and construed in accordance with the substantive
152+
laws of England and Wales whose courts shall have exclusive jurisdiction over all disputes
153+
which may arise between us.
154+
155+
(b) This is the entire agreement between us relating to the Software, and supersedes any prior
156+
purchase order, communications, advertising or representations concerning the Software.
157+
158+
(c) No change or modification of this Agreement will be valid unless it is in writing, and is
159+
signed by us.
160+
161+
(d) The unenforceability or invalidity of any part of this Agreement will not affect the
162+
enforceability or validity of the remaining parts.
163+
164+
BSD Elements of the Software
165+
166+
For BSD elements of the Software, the following terms shall apply:
167+
168+
Copyright as indicated in the header of the individual element of the Software.
169+
170+
All rights reserved.
171+
172+
Redistribution and use in source and binary forms, with or without modification, are
173+
permitted provided that the following conditions are met:
174+
175+
1. Redistributions of source code must retain the above copyright notice, this list of
176+
conditions and the following disclaimer.
177+
178+
2. Redistributions in binary form must reproduce the above copyright notice, this list of
179+
conditions and the following disclaimer in the documentation and/or other materials
180+
provided with the distribution.
181+
182+
3. Neither the name of the copyright holder nor the names of its contributors may be used to
183+
endorse or promote products derived from this software without specific prior written
184+
permission.
185+
186+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
187+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
188+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
189+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
190+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
191+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
192+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
193+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
194+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
195+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
196+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Attention-driven Robotic Manipulation (ARM)
2+
3+
Codebase of Q-attention (within the ARM system) and coarse-to-fine Q-attention (within C2F-ARM system) from the following papers:
4+
5+
- Q-attention: Enabling Efficient Learning for Vision-based Robotic Manipulation (ARM system)
6+
- Coarse-to-Fine Q-attention: Efficient Learning for Visual Robotic Manipulation via Discretisation (C2F-ARM system)
7+
8+
![task grid image missing](readme_files/arm_c2farm.png)
9+
10+
Not that C2F-ARM is the better performing system.
11+
12+
## Installation
13+
14+
ARM is trained using the **YARR framework**. Head to the [YARR github](https://github.com/stepjam/YARR) page and follow
15+
installation instructions.
16+
17+
ARM is evaluated on **RLBench** 1.1.0. Head to the [RLBench github](https://github.com/stepjam/RLBench) page and follow
18+
installation instructions.
19+
20+
Now install project requirements:
21+
```bash
22+
pip install -r requirements.txt
23+
```
24+
25+
## Running experiments
26+
27+
Be sure to have RLBench demos saved on your machine before proceeding. To generate demos for a task, go to the
28+
tools directory in RLBench _(rlbench/tools)_, and run:
29+
```bash
30+
python dataset_generator.py --save_path=/mnt/my/save/dir --tasks=take_lid_off_saucepan --image_size=128,128 \
31+
--renderer=opengl --episodes_per_task=100 --variations=1 --processes=1
32+
```
33+
34+
35+
Experiments are launched via [Hydra](https://hydra.cc/). To start training C2F-ARM on the
36+
**take_lid_off_saucepan** task with the default parameters on **gpu 0**:
37+
```bash
38+
python launch.py method=C2FARM rlbench.task=take_lid_off_saucepan rlbench.demo_path=/mnt/my/save/dir framework.gpu=0
39+
```

arm/__init__.py

Whitespace-only changes.

arm/arm/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import arm.arm.launch_utils

0 commit comments

Comments
 (0)