In [15]: import copy
In [23]: ax = [[1, 2], [3, 4]]
# deepcopy
In [24]: bx = copy.deepcopy(ax)
In [25]: ax
Out[25]: [[1, 2], [3, 4]]
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
#pragma once | |
#ifdef __INTELLISENSE__ | |
void __syncthreads(); | |
#define KERNEL_ARG2(grid, block) | |
#define KERNEL_ARG3(grid, block, sh_mem) | |
#define KERNEL_ARG4(grid, block, sh_mem, stream) | |
#else | |
#define KERNEL_ARG2(grid, block) <<< grid, block >>> | |
#define KERNEL_ARG3(grid, block, sh_mem) <<< grid, block, sh_mem >>> | |
#define KERNEL_ARG4(grid, block, sh_mem, stream) <<< grid, block, sh_mem, stream >>> |
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 tensorflow as tf | |
#aplly exponential decay on learning rate | |
global_step = tf.Variable(0, trainable=False) | |
stater_learning_rate = lr #for start | |
learning_rate = tf.train.exponential_decay(starter_learning_rate, global_step, | |
decay_steps, decay_rate, staircase=True) | |
optimizer = tf.train.AdamOptimizer(learning_rate) |
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
# 实现Batch Normalization | |
def bn_layer(x, is_training, name='BatchNorm', moving_decay=0.9, eps=1e-5): | |
# 获取输入维度并判断是否匹配卷积层(4)或者全连接层(2) | |
shape = x.shape | |
assert len(shape) in [2, 4] | |
param_shape = shape[-1] | |
with tf.variable_scope(name): |
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
def conv_forward_naive(x, w, b, conv_param): | |
""" | |
A naive implementation of the forward pass for a convolutional layer. | |
The input consists of N data points, each with C channels, height H and | |
width W. We convolve each input with F different filters, where each filter | |
spans all C channels and has height HH and width WW. | |
Input: | |
- x: Input data of shape (N, C, H, W) |
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
syntax on | |
colorscheme desert | |
set number | |
set hlsearch | |
set tabstop=4 //实际的tab键占用的space | |
set softtabstop=4 //当敲一个tab键时所占用的space | |
set shiftwidth=4 //自动缩进的space | |
//set expandtab //将tab转化为space | |
set enc=utf-8 | |
set guifont=Monospace\ 12 |
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
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) | |
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). | |
if [ "$PS1" ]; then | |
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then | |
# The file bash.bashrc already sets the default PS1. | |
# PS1='\h:\w\$ ' | |
if [ -f /etc/bash.bashrc ]; then | |
. /etc/bash.bashrc | |
fi |
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
1> block select: | |
##################### | |
asd asd asd asd asd; | |
asd asd asd asd asd; | |
asd asd asd asd asd; | |
asd asd asd asd asd; | |
asd asd asd asd asd; | |
asd asd asd asd asd; | |
asd asd asd asd asd; | |
##################### |
OlderNewer