Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Zanco dangpzanco

  • Florianópolis, Brasil
View GitHub Profile
@mcnees
mcnees / graph paper.tex
Last active Jul 20, 2021
Make your own quadrille, graph, hex, etc paper! Uses the pgf/TikZ package for LaTeX, which should be part of any modern TeX installation.
View graph paper.tex
%%-----------------------------------------------------------------------
%% Make your own quadrille, graph, hex, etc paper!
%% Uses the pgf/TikZ package for LaTeX, which should be part of
%% any modern TeX installation.
%% Email: mcnees@gmail.com
%% Twitter: @mcnees
%%-----------------------------------------------------------------------
\documentclass[11pt]{article}
@shaypal5
shaypal5 / confusion_matrix_pretty_print.py
Last active Jan 14, 2022
Pretty print a confusion matrix with seaborn
View confusion_matrix_pretty_print.py
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14):
"""Prints a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap.
Note that due to returning the created figure object, when this funciton is called in a
notebook the figure willl be printed twice. To prevent this, either append ; to your
function call, or modify the function by commenting out the return expression.
@cwyang
cwyang / regression_keras.py
Last active Dec 18, 2018
polynomial regression try with keras
View regression_keras.py
%matplotlib inline
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import Adam
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#Generate data
num_data=10000
@renexu
renexu / train.py
Created Dec 28, 2017
Keras HDF5Matrix and fit_generator for huge hdf5 dataset
View train.py
import threading
from keras.applications.inception_v3 import InceptionV3
from keras.optimizers import Adam
from keras.utils.io_utils import HDF5Matrix
class threadsafe_iter:
"""Takes an iterator/generator and makes it thread-safe by
serializing call to the `next` method of given iterator/generator.
View line_girl.rb
W = 500
H = 585
W1 = W - 1
H1 = H - 1
def setup
@img = load_image '../scratch/girl.png'
@img.filter BLUR, 3
@img.load_pixels
end
@bogdan-kulynych
bogdan-kulynych / install-cuda-10-bionic.sh
Last active Jan 24, 2022
Install CUDA 10 on Ubuntu 18.04
View install-cuda-10-bionic.sh
# WARNING: These steps seem to not work anymore!
#!/bin/bash
# Purge existign CUDA first
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
# Install CUDA Toolkit 10
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb