Skip to content

Instantly share code, notes, and snippets.

View hfoffani's full-sized avatar

Hernán Foffani hfoffani

View GitHub Profile
@finestructure
finestructure / Readme.md
Last active June 23, 2020 03:09
Homebrew app release
Copyright 2020 Erica Windisch
Permission is hereby granted, free of charge, to any Qualified User obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
* Qualified User: Any person is a Qualified User if engaging in non-commerical, non-profit, or educational use, or unionized persons engaging in for-profit works.
* Non-Qualified User: This software may not be used by any organization that is not considered a Qualified User. Non-Qualified users include non-union employees and contractors acting on behalf of any for-profit corporation, or any employees or contractor
@akashpalrecha
akashpalrecha / an-inquiry-into-matplotlib-figures.ipynb
Last active January 13, 2023 16:32
An Inquiry into Matplotlib's Figures, Axes, subplots and the very amazing GridSpec!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@radekosmulski
radekosmulski / train_on_CIFAR10.py
Created June 20, 2019 19:29
training on CIFAR10 using fastai from the command line
import fire
import fastai
from fastai.vision import *
from torch import nn
from fastai.metrics import top_k_accuracy
path = untar_data(URLs.CIFAR)
data = ImageDataBunch.from_folder(path, valid='test')
class block(nn.Module):
@thomwolf
thomwolf / top-k-top-p.py
Last active January 2, 2024 07:43
Sample the next token from a probability distribution using top-k and/or nucleus (top-p) sampling
def top_k_top_p_filtering(logits, top_k=0, top_p=0.0, filter_value=-float('Inf')):
""" Filter a distribution of logits using top-k and/or nucleus (top-p) filtering
Args:
logits: logits distribution shape (vocabulary size)
top_k >0: keep only top k tokens with highest probability (top-k filtering).
top_p >0.0: keep the top tokens with cumulative probability >= top_p (nucleus filtering).
Nucleus filtering is described in Holtzman et al. (http://arxiv.org/abs/1904.09751)
"""
assert logits.dim() == 1 # batch size 1 for now - could be updated for more but the code would be less clear
top_k = min(top_k, logits.size(-1)) # Safety check
@bhavikngala
bhavikngala / fast_ai_mooc_important_points.md
Last active January 6, 2023 23:04
This gist contains a list of important points from fast.ai "practical deep learning for coders" and "cutting edge deep learning for coders" MOOC

This gist contains a list of points I found very useful while watching the fast.ai "Practical deep learning for coders" and "Cutting edge deep learning for coders" MOOC by Jeremy Howard and team. This list may not be complete as I watched the video at 1.5x speed on marathon but I did write down as many things I found to be very useful to get a model working. A fair warning the points are in no particular order, you may find the topics are all jumbled up.

Before beginning, I want to thank Jeremy Howard, Rachel Thomas, and the entire fast.ai team in making this awesome practically oriented MOOC.

  1. Progressive image resolution training: Train the network on lower res first and then increase the resolution to get better performance. This can be thought of as transfer learning from the same dataset but at a different resolution. There is one paper by NVIDIA as well that used such an approach to train GANs.

  2. Cyclical learning rates: Gradually increasing the learning rate initially helps to avoid getting stuc

@dandanwei
dandanwei / osx_egpu_pytorch_fastai.md
Last active February 16, 2023 10:22
Make Nvidia EGPU working on mac os with Pytorch and Fast.ai

[Updated on 2018.11.14] I finally made my GTX1070 working with my MBP for Pytorch and fast.ai. Below are the steps:

Environment

  • MacBook Pro (15-inch, 2016) with touch bar
  • OSX version: 10.13.6 (Mojave may not work yet as of now)
  • eGPU: Razer Core X + GTX 1070 (MSI)

Steps 1: Install Nvidia Web Driver

@jganzabal
jganzabal / Nvidia Titan XP + MacBook Pro + Akitio Node + Tensorflow + Keras.md
Last active November 2, 2022 11:43
How to setup Nvidia Titan XP for deep learning on a MacBook Pro with Akitio Node + Tensorflow + Keras
###
# !!! THIS IS NOT A BASH SCRIPT !!!
###
# named .sh just so Github does correct syntax highlighting
# Inspired by https://gist.github.com/erikbern/78ba519b97b440e10640
#
# This setup is available as a public AMI in US-East(N. Virginia): ami-9d0f3ff7
# Add repos for cmake and gcc
@dideler
dideler / 0-startup-overview.md
Last active May 3, 2024 11:03
Startup Engineering notes