markdtw / meta-learning-lstm-pytorch Goto Github PK
View Code? Open in Web Editor NEWpytorch implementation of Optimization as a Model for Few-shot Learning
pytorch implementation of Optimization as a Model for Few-shot Learning
see there is a brightness thing for the meta-train-set:
def prepare_data(args):
normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
train_set = EpisodeDataset(args.data_root, 'train', args.n_shot, args.n_eval,
transform=transforms.Compose([
transforms.RandomResizedCrop(args.image_size),
transforms.RandomHorizontalFlip(),
transforms.ColorJitter(
brightness=0.4,
contrast=0.4,
saturation=0.4,
hue=0.2),
transforms.ToTensor(),
normalize]))
val_set = EpisodeDataset(args.data_root, 'val', args.n_shot, args.n_eval,
transform=transforms.Compose([
transforms.Resize(args.image_size * 8 // 7),
transforms.CenterCrop(args.image_size),
transforms.ToTensor(),
normalize]))
test_set = EpisodeDataset(args.data_root, 'test', args.n_shot, args.n_eval,
transform=transforms.Compose([
transforms.Resize(args.image_size * 8 // 7),
transforms.CenterCrop(args.image_size),
transforms.ToTensor(),
normalize]))
train_loader = data.DataLoader(train_set, num_workers=args.n_workers, pin_memory=args.pin_mem,
batch_sampler=EpisodicSampler(len(train_set), args.n_class, args.episode))
val_loader = data.DataLoader(val_set, num_workers=2, pin_memory=False,
batch_sampler=EpisodicSampler(len(val_set), args.n_class, args.episode_val))
test_loader = data.DataLoader(test_set, num_workers=2, pin_memory=False,
batch_sampler=EpisodicSampler(len(test_set), args.n_class, args.episode_val))
meta-learning-lstm-pytorch/dataloader.py
Line 82 in fcc68ba
grad = torch.cat([p.grad.data.view(-1) / args.batch_size for p in learner_w_grad.parameters()], 0)
AttributeError: 'NoneType' object has no attribute 'data'
Has anyone had this problem?
Hello, I am reproducing your code and the following question appears. Could the author help to solve it?Thank you very much!
self.stats['train']['loss'].append(kwargs['loss'])
KeyError: 'train'
Why are is loss being preprocessed? it's already a log quantity and applying something like log(|x|)/p seems very weird to me. Any insights?
I don't think it is but I might be wrong...
What is the GOAT part of the name of your logger mean?
meta-learning-lstm-pytorch/metalearner.py
Line 67 in fcc68ba
Is there a significant performance difference if the learner does NOT get it's c_init trained?
Hi Mr. Mark,
Thank you first for sharing your organized code and reimplementing an important paper.
I have a question regarding the meta-test function, though. Why is there a call for meta-training there? What did I miss?
Thanks again,
Nora
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.