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 tensorflow as tf | |
import numpy as np | |
def smoothed_metric_loss(input_tensor, name='smoothed_triplet_loss', margin=1): | |
''' | |
input_tensor: require a tensor with predefined dimensions (No None dimension) | |
Every two consecutive vectors must be a positive pair. There | |
should not be more than one pair from each class. | |
''' | |
with tf.variable_scope(name): |
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
#!/bin/sh | |
SERVER=$1 | |
ENVNAME=$2 | |
ENV_ROOT="/cvgl/u/chrischoy/.pyv/${SERVER}/${ENVNAME}/bin" | |
# Check the number of arguments | |
if [ "$#" -eq 2 ] && [ -d "${ENV_ROOT}" ]; then | |
export OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH |
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
# Personalized theme based on kafeitu | |
# Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} | |
CURRENT_TIME_="%{$fg_bold[white]%}{%{$fg_bold[yellow]%}%D %T%{$fg_bold[white]%}}%{$reset_color%}" | |
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[cyan]%}@%{$fg_bold[green]%}%m%{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}' | |
RPROMPT='$CURRENT_TIME_' | |
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
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
function cuda_compile( src_path, func_name, matlab_root, cuda_root, out_path, debug) | |
%CUDA_COMPILE general cuda compiling helper for MATLAB version < 2014a | |
if nargin < 6 | |
debug = false; | |
end | |
if ~exist('./bin', 'dir') | |
mkdir('./bin') | |
end |
NewerOlder