Skip to content

Instantly share code, notes, and snippets.

View alceufc's full-sized avatar

Alceu Costa alceufc

View GitHub Profile
@alceufc
alceufc / win_conda_env.md
Last active June 8, 2018 14:05
How to configure a conda environment in Window from a requirements.txt file.

Configuring Conda Environment in Windows

To create the enviroment run on the Anaconda Prompt:

conda create -n [ENVNAME] python=3.6

Activate the enviroment:

Assuming that we have a file .svnignore in the repository home, it is possible to apply the ignore rules recursively using the following command:

svn propset svn:ignore --recursive -F .svnignore .
try:
# Code that throws exception.
except Exception as e:
import pdb
pdb.set_trace()
raise e
%load_ext line_profiler
import line_profiler
%lprun -f [name of functions to analyze] [code to run]
@alceufc
alceufc / softmax.py
Created January 24, 2016 19:45
Compute Softmax function using numpy.
import numpy as np
def softmax(x):
"""
Compute softmax values for each sets of scores in x.
Rows are scores for each class.
Columns are predictions (samples).
"""
scoreMatExp = np.exp(np.asarray(x))