This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torchvision | |
model = torchvision.models.resnet18(pretrained=True) | |
def bn_to_in_inplace(model): | |
for name, module in model.named_children(): | |
if isinstance(module, torch.nn.BatchNorm2d): | |
setattr(model, name, torch.nn.InstanceNorm2d(module.num_features)) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
************************************** TENSOR SIZE (1, 2, 256, 256, 256) ************************************** | |
Iter 1/5, loss: 1.1791579723358154 | |
----------------------------------- --------------- --------------- --------------- --------------- --------------- | |
Name CPU time CUDA time Calls CPU total CUDA total | |
----------------------------------- --------------- --------------- --------------- --------------- --------------- | |
convolution 1993651.502us 1992817.026us 4 7974606.009us 7971268.105us | |
add 1618.376us 6155.640us 4 6473.504us 24622.559us | |
torch::autograd::AccumulateGrad 6500.853us 7.487us 6 39005.119us 44.922us | |
is_floating_point 9.718us 7.812us 1 9.718us 7.812us | |
cudnn_convolution_backward |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "approx" | |
version = "0.1.0" | |
authors = ["Clément Zotti <clement.zotti@imeka.ca>"] | |
[dependencies] | |
ndarray = ">=0.10.12,<0.12.0" | |
num-complex = "0.2.0" | |
[dependencies.approx] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nextflow | |
modes = [0, 1, 2, 3, 4] | |
process gpu_output { | |
echo true | |
script: | |
""" | |
echo \$CUDA_VISIBLE_DEVICES | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "approx" | |
version = "0.1.0" | |
authors = ["Clément Zotti <clement.zotti@imeka.ca>"] | |
[dependencies] | |
ndarray = ">=0.10.12,<0.12.0" | |
num = "0.1" | |
[dependencies.approx] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nibabel as nib | |
def read_file(filename): | |
""" | |
Args: | |
----- | |
filename(str): path of your file | |
Output: | |
------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_updates(self, learning_rate, grads, lr_scalers=None): | |
""" | |
Provides the symbolic (theano) description of the updates needed to | |
perform this learning rule. See Notes for side-effects. | |
Parameters | |
---------- | |
learning_rate : float | |
Learning rate coefficient. | |
grads : dict | |
A dictionary mapping from the model's parameters to their |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <random> | |
#include <set> | |
#include <map> | |
#include <algorithm> | |
#include <chrono> | |
#include <cstdlib> | |
#include <iostream> | |
#include <iomanip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# prepare docker on big hard drive | |
mkdir /home/docker | |
cd /var/lib/ | |
ln -s /home/docker . | |
# Update system | |
pacman -Syu --noconfirm | |
# install tools | |
pacman -S --noconfirm vim emacs docker nginx iptables |