Skip to content

Instantly share code, notes, and snippets.

View Erotemic's full-sized avatar
An eroteme is a question mark

Jon Crall Erotemic

An eroteme is a question mark
View GitHub Profile
@Erotemic
Erotemic / output_shape_for.py
Created November 20, 2017 21:54
Output shape information for pytorch
import math
import torch
import torch.nn as nn
import torchvision
REGISTERED_OUTPUT_SHAPE_TYPES = []
def compute_type(type):
def _wrap(func):
@Erotemic
Erotemic / gist:cb14439beefa8ad61695c9f819f0839b
Created October 30, 2017 17:21
Output of serial fletch make
This file has been truncated, but you can view the full file.
(venv2) joncrall@calculex:~/code/fletch/build-py2-test$ make
Scanning dependencies of target PyBind11
[ 0%] Creating directories for 'PyBind11'
[ 0%] Performing download step (download, verify and extract) for 'PyBind11'
-- verifying file...
file='/home/joncrall/code/fletch/Downloads/pybind11-2.2.0.tar.gz'
-- File already exists and hash match (skip download):
file='/home/joncrall/code/fletch/Downloads/pybind11-2.2.0.tar.gz'
MD5='978b26aea1c6bfc4f88518ef33771af2'
-- extracting...
#!/bin/bash
codeblock()
{
if [ "-h" == "$1" ] || [ "--help" == "$1" ]; then
# Use codeblock to show the usage of codeblock, so you can use
# codeblock while you codeblock.
echo "$(codeblock '
Unindents code before its executed so you can maintain a pretty
indentation in your code file. Multiline strings simply begin
@Erotemic
Erotemic / activate_patch.diff
Created October 25, 2017 17:22
venv activate patch
--- /home/joncrall/venv2/bin/activate.old 2017-10-25 13:18:36.981600140 -0400
+++ /home/joncrall/venv2/bin/activate 2017-10-25 13:20:02.878155488 -0400
@@ -8,7 +8,15 @@
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then
PATH="$_OLD_VIRTUAL_PATH"
+ C_INCLUDE_PATH="$_OLD_C_INCLUDE_PATH"
+ LD_LIBRARY_PATH="$_OLD_VIRTUAL_LD_LIBRARY_PATH"
+
export PATH
(venv2) joncrall@calculex:~$ cd ~/code/VIAME/examples/tracking_pipelines
(venv2) joncrall@calculex:~/code/VIAME/examples/tracking_pipelines$ ~/code/VIAME/build-py2/install/bin/pipeline_runner -p ~/code/VIAME/examples/tracking_pipelines/simple_tracker.pipe
INFO: Could not load default logger factory. Using built-in logger.
2017-10-24 11:01:28.483 WARN registration.cxx(96): Path not found loading clusters: /home/joncrall/code/VIAME/build-py2/install/share/sprokit/pipelines/clusters
/home/joncrall/code/VIAME/build-py2/install/lib/python2.7/site-packages/sprokit/pipeline/__init__.py:30: RuntimeWarning: to-Python converter for std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > already registered; second conversion method ignored.
from config import *
/home/joncrall/code/VIAME/build-py2/install/lib/python2.7/site-packages/sprokit/pipeline/__init__.py:31: RuntimeWarning: to-Python converter for std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > already regi
Oct 22 16:05:36 Ooo gnome-session[2020]: ('file scheme: ', 'file')
Oct 22 16:05:36 Ooo gnome-session[2020]: ('Handling file: ', 'file:///home/joncrall/logs/sensors.2017-10-22_14:52.log')
Oct 22 16:05:36 Ooo gnome-session[2020]: ('file scheme: ', 'file')
Oct 22 16:05:36 Ooo gnome-session[2020]: ('Handling file: ', 'file:///home/joncrall/logs/sensors.2017-10-22_14:52.log')
Oct 22 16:05:36 Ooo gnome-session[2020]: ('file scheme: ', 'file')
Oct 22 16:05:36 Ooo gnome-session[2020]: ('Handling file: ', 'file:///home/joncrall/logs/sensors.2017-10-22_14:52.log')
Oct 22 16:05:36 Ooo gnome-session[2020]: ('file scheme: ', 'file')
Oct 22 16:05:36 Ooo gnome-session[2020]: ('Handling file: ', 'file:///home/joncrall/logs/sensors.2017-10-22_14:52.log')
nct6776-isa-0290
Adapter: ISA adapter
Vcore: +0.97 V (min = +0.00 V, max = +1.74 V)
in1: +1.03 V (min = +0.00 V, max = +0.00 V) ALARM
AVCC: +3.41 V (min = +2.98 V, max = +3.63 V)
+3.3V: +3.39 V (min = +2.98 V, max = +3.63 V)
in4: +1.00 V (min = +0.00 V, max = +0.00 V) ALARM
in5: +2.04 V (min = +0.00 V, max = +0.00 V) ALARM
in6: +0.83 V (min = +0.00 V, max = +0.00 V) ALARM
3VSB: +3.42 V (min = +2.98 V, max = +3.63 V)
def explicit_testdir():
"""
Explicitly constructs a testdir for use in IPython development
Note used by any tests.
"""
import _pytest
config = _pytest.config._prepareconfig(['-s'], plugins=['pytester'])
session = _pytest.main.Session(config)
_pytest.tmpdir.pytest_configure(config)
_pytest.fixtures.pytest_sessionstart(session)
@Erotemic
Erotemic / bench_confusion_matrix.py
Created September 28, 2017 03:17
Scikit-Learn Confusion Matrix Benchmark
import numpy as np
from sklearn.metrics.classification import (unique_labels, _check_targets,
check_consistent_length,
coo_matrix)
def confusion_matrix_orig(y_true, y_pred, labels=None, sample_weight=None):
y_type, y_true, y_pred = _check_targets(y_true, y_pred)
if y_type not in ("binary", "multiclass"):
raise ValueError("%s is not supported" % y_type)
@Erotemic
Erotemic / old_versioning_description.md
Created September 14, 2017 15:57
Old Versioning Description

Initial work for updating fletch to target python3.

I still haven't gotten this to build all the way through yet, so for now its just a work in progress.

This combines PRs #172 #173 #174 #175 #177 and #186 which each pertain to their own library --- opencv, caffe (which is in there twice), vtk, ffmpeg, and openblas --- and then adds initial support for python3, which is used by multiple libraries.

Current Status:

This branch merges the branches from the other PRs I've recently submitted and then adds initial support for python3 on top. By default only one package (OpenBLAS) has changed versions because it seems that this update never caused any issues in my tests. The other packages still hicup every so often when switching to their new version (some more than others).