This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Makie | |
using MakieLayout | |
using NIfTI | |
nipath = "T1.nii.gz" | |
nidata = niread(nipath) | |
data = Float32.(nidata) ./ maximum(nidata) | |
function axhline!(la::LAxis, y::Node; kwargs...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# experimentation with batched tridiagonal solvers on the GPU for Oceananigans.jl | |
# | |
# - reference serial CPU implementation | |
# - batched GPU implementation using cuSPARSE (fastest) | |
# - batched GPU implementation based on the serial CPU implementation (slow but flexible) | |
# - parallel GPU implementation (potentially fast and flexible) | |
# | |
# see `test_batched` and `bench_batched` | |
using CUDAdrv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here I store more data as I go, | |
# which I could use to plot figures comparing methods | |
# the convergence speed of different methods | |
# I use the Rosenbrock classic example and | |
# Optim.jl as an iterative process which will | |
# call f multiple times to find its minimum | |
# and I plot the convergence vs time | |
using Optim, Cassette |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import product | |
import numpy as np | |
INV_SQRT_3 = 1.0 / np.sqrt(3.0) | |
ASIN_INV_SQRT_3 = np.arcsin(INV_SQRT_3) | |
def gaussian_bell(xs, ys, xc=0., yc=0., xsigma=1., ysigma=1.): | |
""" Compute a 2D Gaussian with asymmetric standard deviations and |