cnguyen10 / few_shot_meta_learning Goto Github PK
View Code? Open in Web Editor NEWImplementations of many meta-learning algorithms to solve the few-shot learning problem in Pytorch
License: MIT License
Implementations of many meta-learning algorithms to solve the few-shot learning problem in Pytorch
License: MIT License
Hi Cuong,
Thanks for your great work.
I want to ask about the test function in Platius.py what is the meaning of eps_generator in test function
Hi Cuong,
I really appreciate your work for the VAMPIRE algorithm. There are some questions about the implementation in Vampire2.py.
Thank you.
Hi,
when trying to run Platipus.py with the provided defaults:
python3 main.py --datasource SineLine --ml-algorithm platipus --num-models 4 --first-order --network-architecture FcNet --no-batchnorm --num-ways 1 --k-shot 5 --inner-lr 0.001 --meta-lr 0.001 --num-epochs 100 --resume-epoch 0 --train
the following error occurs:
Platipus.py, line 195: ValueError: Loss is NaN.
Do you have any idea what might cause this? Doesn't seem to be a config issue since both defaults and altered params don't get any other results.
Thanks!
Leon
If I understand it right, the distribution of theta0 is not a vanilla Normal distribution as it's written in the application details in the original paper and instead it's a distribution of a normal distribution multiplied by a gamma distribution. However in your code I am confused about how is that presents as it seems that you just initialize mean and logsigma of theta0. How did you implement this part? I am struggling implementing a similar algorithm like abml and really really hope you can give some help. thx:)
Hi, thank you for the wonderful code!
Are there any plans to open the code of regression models?
Thanks!
Jihoon
Thanks for publishing these implementations. I was running ABML on Omniglot for (20/5, 20/1, 5/5, and 5/1) n-way k-shot learning problems. On all four of the above experiments I start getting NaN's for ABML around epoch 12-14. Its weird that they all fail at the same spot. I have looked through the code carefully and I cannot see anything directly which might cause this, but you may have a better idea since you implemented it...
Any ideas where this is coming from? Here are the flags I was using to train. I may have added some flags related to dataloading, but nothing that interferes with the core.
python main.py \
--datasource=$DATASET \
--ds-folder $ROOT \
--run $RUN \
--ml-algorithm=abml \
--num-models=2 \
--minibatch 16 \
--no-batchnorm \
--n-way=20 \
--k-shot=5 \
--v-shot=$VSHOT \
--num-epochs=40 \
--num-episodes-per-epoch 10000 \
--resume-epoch=0 \
--train
When calculating the calibration, why it adds some noise to the target in regression?
Like this,
outputs = outputs + (self.noise_std2)output_noises*
And should it be
outputs = outputs + self.noise_std*output_noises
As we all know, MAML can only calculate one value for a input, then how can it calculate the reliability diagram like fig 2(c) in you paper?
Thank you very much for your kind consideration and I am looking forward to your early reply.
Hi Cuong,
I really appreciate your work, especially this is the only piece of implementation of ABML I could find.
However,
when you calculate the loss for updating the meta-parameters here, it seems that you left the
behind.
I hope you could check this out. Looking forward to your reply.
Hi. Thank you for uploading the code for all these algorithms.
For the implementation of bayesian maml (classification problem), you are using simple cross-entropy loss. But, bayesian maml uses the chaser loss. Specifically, for each task, I think we have to compute the chaser and leader using SVGD and then update the global parameters using the average of the difference over multiple particles (multiple models) (This might be much tricker).
Did I miss something in this implementation? Correct me if I am wrong or I missed something.
thanks,
Deep
Hello, I want to utilize BMAML and PLATIPUS to multi-label sequence(1D) classification, and the code is really helpful! The difficulty I face now is that there are too many files, and I don't know in what order should I modify the code. Could you please give me some advice and help?
Hi,
I like your repository and the code you have implemented. I am facing a couple of issues:
The dataset - i cannot find the dataset in the format you have asked. I have tried using the dataloader from torchmeta to run with your code but the issue is that most of your code when run does not go beyond 20.00 accuracy. Do you have any advice on what I may do?
The inputs
always set to q_params
, no matter the first-order is true or false. Is this a typo?
if config['first_order']:
all_grads = torch.autograd.grad(
outputs=loss,
inputs=q_params,
retain_graph=config['train_flag']
)
else:
all_grads = torch.autograd.grad(
outputs=loss,
inputs=q_params,
create_graph=config['train_flag']
)
Hi,
thank you for the great implementation of meta learning algorithms.
We are trying to evaluate the PLATIPUS algorithm and we noted that the paper requires a Negative Log Likelihood loss (Page 3, 3 Preliminaries), yet your adaptation step by default is using an MSE loss.
We were wondering if this is an adaptation of the original paper on your part or if we’re missing a crucial step where the NLL is calculated from the MSE. Later the loss we’re suspecting to be an MSE loss is logged to Tensorboard as a NLL again(Platipus.py, 216
). This seems especially important since in Platipus.py, 184
the gradient is calculated on this loss function. To our understanding, this gradient might differ significantly from the gradient intended in the paper since it is calculated on a different loss function.
Is this just a trick in the implementation to use the MSE instead of the NLL or are we missing something in the implementation?
Thanks a lot in advance,
Leon
Hi.
Thanks you so much for sharing the code.
i cloned your repo and i tried to run abml.py with sine curve. I get nan loss and the code exits.
Please let me know if i need to change any hyper parameters for this task.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.