Comments (4)
The array valid_returns
contains the returns for the episodes sampled after adaptation. This array has size (meta_batch_size, fast_batch_size)
. Taking the average and standard error over the whole valid_returns
array will give you numbers that correspond to the value for 1 gradient step (assuming you are doing 1 gradient step adaptation) from Figure 5 in the MAML paper. If you take the average and standard error over the second axis only (valid_returns.mean(1)
), you can get the orange curve in Figure 1 in the Negative adaptation in MAML paper (and use the tasks
list to know which task the values correspond to).
The array train_returns
is an array with the same shape, containing the returns before any adaptation step. With the same statistics as above, it corresponds to 0 gradient steps in Figure 5 of the MAML paper and the blue curve in Figure 1 of the Negative adaptation in MAML paper.
from pytorch-maml-rl.
Thanks a lot for your kind reply! That's really helpful. While I still have one more question to ask. In the python file maml_trpo, what is the role of the function " async def adapt(self, train_futures, first_order=None)" ? Cause I thought the adaptation process happens in the " multi_task sampler" file. Thanks again for your time and patience.
from pytorch-maml-rl.
There is indeed adaptation in two different places:
- In
MultiTaskSampler
there is adaptation to sample adapted ("validation") episodes. This adaptation step is only done to collect data used for optimization inMAMLTRPO
later (that's why there is afirst_order=True
in theupdate_params
function). We're not backpropagating through the gradient update here. - In
MAMLTRPO
there is theadapt
function which does the exact same adaptation step (based on the "training" episodes), but this is for optimization only this time. Using thisadapt
function, we can then backpropagate through the gradient update. Unlike inMultiTaskSampler
, we don't use these adapted parameters to sample "validation" episodes, because we already have them available thanks toMultiTaskSampler
So it looks like this is wasteful to do the adaptation twice (once for sampling episodes, another for optimization), but this allows complete decoupling of sampling and optimization, and makes the overall process significantly faster. An earlier version of this repo which had sampling and optimization entangled was 10x slower.
from pytorch-maml-rl.
Got it, thank you so much!!!
from pytorch-maml-rl.
Related Issues (20)
- AttributeError: Can't pickle local object 'make_env.<locals>._make_env' HOT 4
- if i want employe this work to a new env, what should i do HOT 7
- Cuda Support Issue HOT 2
- what is the mean of train_episodes and valid_episodes? HOT 4
- If I want to use the the meta-parameters to adapt to new task, what should I do? HOT 2
- TypeError: list indices must be integers or slices, not str HOT 1
- Fails to converge on bandit tasks HOT 1
- Can not read your env in the Jupyter HOT 1
- how can I adapt maml on my own environment? HOT 1
- How do you get the baseline curve in Fig5 in your paper? HOT 1
- train_returns and valid_returns seems to be equal
- where to setup render value of mujoco environment? HOT 1
- is it posible to combine DPPG with MAML?
- How to solve the problem of Nan value during training?
- The progress bar doesn't increase at all HOT 4
- raise EOFError
- EOFError BrokenPipeError: [WinError 109]
- Traceback (most recent call last): File "D:\Anaconda3\envs\testenv\lib\multiprocessing\process.py", line 258, in _bootstrap self.run() File "F:\aa_maml\MAML-Pytorch-RL-master\maml_rl\envs\subproc_vec_env.py", line 61, in run command, data = self.remote.recv() File "D:\Anaconda3\envs\testenv\lib\multiprocessing\connection.py", line 312, in _recv_bytes nread, err = ov.GetOverlappedResult(True) File "D:\Anaconda3\envs\testenv\lib\multiprocessing\connection.py", line 250, in recv buf = self._recv_bytes() File "D:\Anaconda3\envs\testenv\lib\multiprocessing\connection.py", line 321, in _recv_bytes raise EOFError EOFError BrokenPipeError: [WinError 109] I run the code on win10 but this error occurred.
- Sync Vec porting
- After running the train.py, error "Unable to solve the normal equations in `LinearFeatureBaseline`. The matrix X^T*X (with X the design matrix) is not full-rank, regardless of the regularization (maximum regularization: 1.0)." occurs.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-maml-rl.