Skip to content

Instantly share code, notes, and snippets.

View jgomezdans's full-sized avatar

José Gómez-Dans jgomezdans

View GitHub Profile
@jgomezdans
jgomezdans / latexdiff.md
Created September 15, 2022 11:48 — forked from adam-binks/latexdiff.md
How to LaTeX diff your Overleaf project

How to LaTeX diff your Overleaf project

Set up local latex environment

Grab the two versions

  • Download the original version
    • Go to Overleaf > history > find the version > view single version > download project at this version
  • Download the current version
@jgomezdans
jgomezdans / xarray-temporal-fit.ipynb
Created April 24, 2020 15:22 — forked from scottyhq/xarray-temporal-fit.ipynb
polynomial fit with xarray in time
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.
@jgomezdans
jgomezdans / life.py
Created August 16, 2012 14:24 — forked from teoliphant/life.py
Array-oriented version of the game of life
from numpy.random import rand
from numpy import r_, ix_, uint8, roll
import matplotlib.pyplot as plt
import time
size = 200
GRID = (rand(size,size) > 0.75).astype(uint8)
# Rotate indices because the world is round
indx = r_[0:size]
up = roll(indx, -1)
@jgomezdans
jgomezdans / hinton.py
Created April 13, 2012 16:33 — forked from eliask/hinton.py
A function for drawing Hinton diagrams with matplotlib.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# https://gist.github.com/292018 - augmented to plot row/column labels
"""
Draws Hinton diagrams using matplotlib ( http://matplotlib.sf.net/ ).
Hinton diagrams are a handy way of visualizing weight matrices, using
colour to denote sign and area to denote magnitude.
By David Warde-Farley -- user AT cs dot toronto dot edu (user = dwf)
with thanks to Geoffrey Hinton for providing the MATLAB code off of
# Version from SciPy.signal
def correlate(in1, in2, mode='full'):
"""Cross-correlate two N-dimensional arrays.
Description:
Cross-correlate in1 and in2 with the output size determined by mode.
Inputs:
from __future__ import division
from scikits.audiolab import flacread
from numpy.fft import rfft, irfft
from numpy import argmax, sqrt, mean, diff, log
from matplotlib.mlab import find
from scipy.signal import blackmanharris, fftconvolve
from time import time
import sys
# Faster version from http://projects.scipy.org/scipy/browser/trunk/scipy/signal/signaltools.py