- Assume NVIDIA Driver and CUDA Properly Installed, to Validate:
nvidia-smi
nvcc --version
- Install Global Dependencies
from __future__ import division | |
import numpy as np | |
from matplotlib import pyplot as plt | |
import networkx as nx | |
import copy | |
class Graph: | |
def __init__(self,adj,labels): | |
self.adj = adj | |
self.char_list = labels |
# pytorch function to replicate tensorflow's tf.nn.softmax_cross_entropy_with_logits | |
# works for soft targets or one-hot encodings | |
import torch | |
import torch.nn.functional as F | |
logits = model(input) | |
loss = torch.sum(- target * F.log_softmax(logits, -1), -1) | |
mean_loss = loss.mean() |
nvidia-smi
nvcc --version
Sometimes you need to edit a file on a remote server, but using vim/emacs is not very practical, due to lag and speed of screen refresh.
TextMate users have the classic rmate, but it was implemented in Ruby, which may not be available on the remote server.
A better option is to use this version of rmate, implemented in pure Bash. It's a single file, self-contained, and with no external dependencies.
Step by step:
n02119789 1 kit_fox | |
n02100735 2 English_setter | |
n02110185 3 Siberian_husky | |
n02096294 4 Australian_terrier | |
n02102040 5 English_springer | |
n02066245 6 grey_whale | |
n02509815 7 lesser_panda | |
n02124075 8 Egyptian_cat | |
n02417914 9 ibex | |
n02123394 10 Persian_cat |
#!/usr/bin/env bash | |
#Check Files in list from file exist or doesn't exist in directory. | |
if [ $# -eq 0 ] || [ $# -eq 1 ] | |
then | |
echo "You must pass the path to file with the list and the path to directory to check files. \nsh check-file-exist-from-list.sh path/to/file path/to/directory" | |
exit 1 | |
fi | |
while read -r file; do |
import numpy as np | |
import pdb | |
from sklearn.datasets import make_classification | |
from sklearn.mixture import GaussianMixture as GMM | |
def fisher_vector(xx, gmm): | |
"""Computes the Fisher vector on a set of descriptors. |
from scipy.stats import exponweib | |
from scipy.optimize import fmin | |
import numpy as np | |
# x is your data array | |
# returns [shape, scale] | |
def fitweibull(x): | |
def optfun(theta): | |
return -np.sum(np.log(exponweib.pdf(x, 1, theta[0], scale = theta[1], loc = 0))) |
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008 | |
Compiled by Eric Pement - eric [at] pement.org version 0.27 | |
Latest version of this file (in English) is usually at: | |
http://www.pement.org/awk/awk1line.txt | |
This file will also be available in other languages: | |
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt | |
USAGE: |
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> | |
<script src="jquery.innerfade.js" type="text/javascript"></script> | |
<script> | |
$(document).ready(function() { | |
$('#image_rotate').innerfade({ | |
speed: 'slow', | |
timeout: 2000, | |
type: 'sequence', | |
containerheight: '220px' | |
}); |