This file contains hidden or 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
#设置前缀为Ctrl + a | |
unbind ^b | |
set -g prefix 'C-a' | |
#将r 设置为加载配置文件,并显示信息 | |
bind r source-file ~/.tmux.conf \; display-message "Config reloaded" | |
#up | |
bind-key k select-pane -U | |
#down | |
bind-key j select-pane -D |
This file contains hidden or 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
"Pathogen | |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
"NERDtree | |
" open NERDTree with ctrl+n | |
map <F2> :NERDTreeToggle<CR> | |
" close vim if the only window left open is a NERDTree | |
autocmd bufenter * if(winnr("$")==1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif |
This file contains hidden or 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
# ### python_ncut_lib.py | |
# Copyright (C) 2010 R. Cameron Craddock ([email protected]) | |
# | |
# This script is a part of the pyClusterROI python toolbox for the spatially constrained clustering of fMRI | |
# data. It provides the library functions for performing normalized cut clustering according to: | |
# | |
# Shi, J., & Malik, J. (2000). Normalized cuts and image segmentation. IEEE Transactions on Pattern Analysis | |
# and Machine Intelligence, 22(8), 888-905. doi: 10.1109/34.868688. | |
# | |
# Yu, S. X., & Shi, J. (2003). Multiclass spectral clustering. Proceedings Ninth IEEE International Conference |
This file contains hidden or 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
#adjust learning rate policy by callbacks | |
def scheduler(epoch): | |
if epoch == 5: | |
model.lr.set_value(.02) | |
return model.lr.get_value() | |
change_lr = LearningRateScheduler(scheduler) | |
model.fit(x_embed, y, nb_epoch=1, batch_size = batch_size, show_accuracy=True, | |
callbacks=[chage_lr]) |
This file contains hidden or 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 torch.nn as nn | |
import torch.nn.parallel | |
class DCGAN_D(nn.Container): | |
def __init__(self, isize, nz, nc, ndf, ngpu, n_extra_layers=0): | |
super(DCGAN_D, self).__init__() | |
self.ngpu = ngpu | |
assert isize % 16 == 0, "isize has to be a multiple of 16" |
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 hidden or 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 numpy as np | |
from scipy.ndimage.interpolation import map_coordinates | |
from scipy.ndimage.filters import gaussian_filter | |
def elastic_transform(image, alpha, sigma, random_state=None): | |
"""Elastic deformation of images as described in [Simard2003]_. | |
.. [Simard2003] Simard, Steinkraus and Platt, "Best Practices for | |
Convolutional Neural Networks applied to Visual Document Analysis", in |
This file contains hidden or 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
#plot tiled images | |
fig = plt.figure(figsize=(8,8)) | |
#adjust the white space around the figure and each subplot | |
plt.subplots_adjust(wspace=0.01, hspace=0.01, left=0, right=1, bottom=0, top=1) | |
for i in range(63): | |
ax = plt.subplot(8,8,i+1) | |
plt.imshow(imgs[i]) | |
ax.axis('off') #no frame | |
#ax.get_xaxis().set_visible(False) | |
#ax.get_yaxis().set_visible(False) |
This file contains hidden or 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 numpy as np | |
import matplotlib.pyplot as plt | |
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
import torch.nn.functional as F | |
from torch.autograd import Variable | |
import torchvision | |
import torchvision.transforms as transforms | |
import numpy as np |
This file contains hidden or 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
### Adapted from TF repo | |
import tensorflow as tf | |
from tensorflow import gradients | |
from tensorflow.python.framework import ops | |
from tensorflow.python.ops import array_ops | |
from tensorflow.python.ops import math_ops | |
def hessian_vector_product(ys, xs, v): |