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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
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 | |
torch.backends.cudnn.deterministic = True | |
import torch.nn as nn | |
class UNet3d(nn.Module): | |
def __init__(self, activation=nn.ReLU, pooling=nn.MaxPool3d): | |
super().__init__() | |
self.down0 = nn.Sequential( |
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 os | |
os.environ["CUDA_VISIBLE_DEVICES"] = "0" | |
import torch | |
import torch.nn as nn | |
import numpy as np | |
def get_upsampling_weight(in_channels, out_channels, kernel_size): | |
"""Make a 2D bilinear kernel suitable for upsampling""" | |
factor = (kernel_size + 1) // 2 |
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
{ | |
"ps":[ | |
{ | |
"host":"localhost", | |
"port":2222 | |
} | |
], | |
"worker":[ | |
{ | |
"host":"localhost", |
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
# Simple script for experiments with dsitributed TensorFlow. | |
# Requires jq utility for JSON parsing. Example JSON file can be found on the gist. | |
# Args: | |
# name of script to run, example: train.py | |
# file with cluster configuration, example: hosts.json | |
#!/bin/bash | |
script=$1 | |
hosts=$2 |
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
set encoding=utf-8 | |
set nocompatible " required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins |
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
Show hidden characters
{ | |
"translate_tabs_to_spaces": true, | |
"tab_size": 4, | |
"rulers": [72, 79], | |
"indent_to_bracket": true, | |
} |
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
# IDEs | |
*.sublime-project | |
*.sublime-workspace | |
*.vim | |
*~ | |
*.swp | |
*.swo | |
.idea | |
# Data files |
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
# win32com multithreading example | |
import sys | |
import time | |
from threading import Thread | |
sys.coinit_flags = 0 # pythoncom.COINIT_MULTITHREADED == 0 | |
from pythoncom import (CoInitializeEx, CoUninitialize, | |
COINIT_MULTITHREADED, PumpWaitingMessages) | |
from win32com.client import Dispatch, WithEvents | |