Skip to content

Instantly share code, notes, and snippets.

@GerardBCN
GerardBCN / stock_price_autoencoding.ipynb
Created January 18, 2019 21:15
Stock market Bitcoin data compression with autoencoders
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kstrauser
kstrauser / black.md
Last active March 18, 2023 00:24
Using the "black" Python formatter in VS Code

This is how to use the Black Python code formatter in VS Code.

Make a Python 3.6 virtualenv for running Black

Black itself requires Python 3.6 to run, but few of our projects are on that version. The VS Code plugin conveniently lets you run black from its own virtualenv.

I had to give a specific version of black this morning. I didn't yesterday. Don't specify the version unless it makes you (and if you do, give the current version, not the one from this doc).

$ cd ~/Envs
@daveluo
daveluo / cifar10-darknet-gist0509.ipynb
Last active May 13, 2019 16:35
Demo of CPU-only Predictions and Pytorch Model Saving/Loading, 5/9/2018
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@binga
binga / pascal_pandas.ipynb
Last active April 22, 2020 21:45
A quick way to get the bounding boxes in fastai csv format ready for bounding box regression using Pandas.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tarlen5
tarlen5 / calculate_mean_ap.py
Last active November 6, 2024 19:45
Calculate mean Average Precision (mAP) for a set of ground truth and predicted bounding boxes for a set of images.
"""
author: Timothy C. Arlen
date: 28 Feb 2018
Calculate Mean Average Precision (mAP) for a set of bounding boxes corresponding to specific
image Ids. Usage:
> python calculate_mean_ap.py
Will display a plot of precision vs recall curves at 10 distinct IoU thresholds as well as output
@zhanwenchen
zhanwenchen / Install NVIDIA Driver and CUDA.md
Last active March 13, 2024 23:42 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA CUDA 9.0 on Ubuntu 16.04.4 LTS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kyamagu
kyamagu / binary_classification_utils.py
Created June 15, 2017 13:12
Helper for binary classification training in PyTorch
"""
Use in PyTorch.
"""
def accuracy(output, target):
"""Computes the accuracy for multiple binary predictions"""
pred = output >= 0.5
truth = target >= 0.5
acc = pred.eq(truth).sum() / target.numel()
return acc
import os
import sys
import numpy as np
from data_util import *
import datetime
ply_filelist = 'scripts/modelnet40_ply_filelist_shuffled.txt'
H5_BATCH_SIZE = 2000