Skip to content

Instantly share code, notes, and snippets.

@egrefen
egrefen / maml_train.py
Last active May 12, 2021 08:15
Train maml model with torchmeta and higher v0.2.
# Based on the code in https://github.com/tristandeleu/pytorch-meta/tree/master/examples/maml
# Basically, we only use the dataset loaders/helpers from TorchMeta and replace usage of MetaModules
# with normal pytorch nn.Modules, letting higher deal with making the inner loop unrollable and the
# optimizers differentiable. This makes it easier to use another optimizer than SGD, or any arbitrary
# third-party model, when doing MAML using this codebase.
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
@egrefen
egrefen / HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install
Created January 31, 2013 13:42
Homebrew tbb install problems
==> Downloading http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20121003oss_src.tgz
Already downloaded: /Library/Caches/Homebrew/tbb-4.1u1.tgz
/usr/bin/tar xf /Library/Caches/Homebrew/tbb-4.1u1.tgz
==> make tbb_build_prefix=BUILDPREFIX CONLY=cc CPLUS=c++ arch=intel64
make tbb_build_prefix=BUILDPREFIX CONLY=cc CPLUS=c++ arch=intel64
Created ./build/BUILDPREFIX_release and ..._debug directories
/usr/bin/make -C "./build/BUILDPREFIX_debug" -r -f ../../build/Makefile.tbb cfg=debug tbb_root=../..
../../build/Makefile.tbb:39: CONFIG: cfg=debug arch=intel64 compiler=gcc os=macos runtime=cc4.2.1_os10.8.2
c++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -m64 -fPIC -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_hash_map.cpp
brew: superenv removed: -g -O0 -m64 -Wall -Wno-non-virtual-dtor
Your system is raring to brew.