Skip to content

Instantly share code, notes, and snippets.

View Alexander-Barth's full-sized avatar

Alexander Barth Alexander-Barth

View GitHub Profile
#
# This script should run as root
# We assume that the student's account is called "etudiant".
#
JULIA_VERSION=1.8.3
USER=etudiant
# array with major, minor and revision number
JULIA_VERSION_PARTS=( ${JULIA_VERSION//./ } )
@Alexander-Barth
Alexander-Barth / test_netcdf_msys.sh
Last active June 9, 2022 09:33
NetCDF MSYS2 julia
# see https://github.com/Alexander-Barth/NetCDF-CI-Builder
pacman -Syu
pacman -Syu
pacman -S git emacs diffutils mingw-w64-x86_64-gdb mingw-w64-x86_64-netcdf \
mingw-w64-x86_64-hdf5 mingw-w64-x86_64-gcc m4 mingw-w64-x86_64-make make patch \
autoconf automake libtool
@Alexander-Barth
Alexander-Barth / test_resnet.jl
Created February 7, 2022 15:40
PyTorch-resnet-for-flux
# needs julia 1.6 as long as this issue is open:
# https://github.com/JuliaIO/BSON.jl/issues/107
# License MIT
using Flux
import Metalhead
using DataStructures
using Statistics
using BSON
@Alexander-Barth
Alexander-Barth / profile-julia-1.5.3-resblock5.log
Created September 24, 2021 10:55
profile-julia-1.5.3-resblock5.log
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
╎423 @Base/client.jl:506; _start()
╎ 423 @Base/client.jl:296; exec_options(::Base.JLOptions)
╎ 423 @Base/Base.jl:368; include(::Module, ::String)
10╎ 423 @Base/Base.jl:380; include(::Function, ::Module, ...
╎ 4 ...mpiler/typeinfer.jl:601; typeinf_ext(::Core.MethodInsta...
╎ 4 ...piler/typeinfer.jl:570; typeinf_ext(::Core.MethodInst...
╎ ╎ 4 ...piler/typeinfer.jl:67; typeinf(::Core.Compiler.Infer...
3╎ ╎ 3 ...iler/typeinfer.jl:122; cache_result(::Core.Compiler...
@Alexander-Barth
Alexander-Barth / profile-julia-1.7.0-rc1-resblock5.log
Created September 24, 2021 10:54
profile-julia-1.7.0-rc1-resblock5.log
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
╎80490 @Base/client.jl:495; _start()
╎ 80490 @Base/client.jl:292; exec_options(opts::Base.JLOpt...
╎ 80490 @Base/Base.jl:420; include(mod::Module, _path::...
╎ 80490 @Base/loading.jl:1253; _include(mapexpr::Function,...
╎ 80490 @Base/loading.jl:1196; include_string(mapexpr::typ...
4╎ 80490 @Base/boot.jl:373; eval
45╎ ╎ 80486 ...ler/interface.jl:343; pullback(f::Function, ps::...
╎ ╎ 28 ...ler/typeinfer.jl:938; typeinf_ext_toplevel(mi::...
@Alexander-Barth
Alexander-Barth / flux_vae.jl
Created June 2, 2021 16:21
convolutional varitional autoencoder in Flux.jl
# adapted from
# Keras_code_sample_for_Google_IO_2021
# Modern Keras design patterns | Session
# https://www.youtube.com/watch?v=FCz9m4T0DI0
# code: https://goo.gle/3t0rSpo
# by Martin Gorner, François Chollet
using Flux
using MLDatasets
using Random
JULIA_VERSION=1.8.3
USER=student
# array with major, minor and revision number
JULIA_VERSION_PARTS=( ${JULIA_VERSION//./ } )
# just major and minor number
JULIA_VERSION_SHORT=${JULIA_VERSION_PARTS[0]}.${JULIA_VERSION_PARTS[1]}
mkdir -p /opt
using BinaryBuilder
# Collection of sources required to build HDF5
name = "HDF5"
version = v"1.12.0"
sources = [
GitSource("https://github.com/steven-varga/hdf5.git",
"b49b22d6882d97b1ec01d482822955bd8e923203"),
# Crib MacOS binaries from PyPI
@Alexander-Barth
Alexander-Barth / GeoRefDatasets.jl
Last active October 10, 2019 14:18
GeoRefDatasets
"""
Example module for georeferenced datasets
"""
module GeoRefDatasets
using Test
import Base: getindex, size, view
@Alexander-Barth
Alexander-Barth / gist:d07c20746f77c607de5a2f71f5ba4e6b
Last active April 26, 2019 14:39
jupyter notebook desktop launcher
mkdir ~/.local/share/applications
cd ~/.local/share/applications
cat > jupyter.desktop <<EOF
[Desktop Entry]
Name=Jupyter
Exec=jupyter-notebook
Terminal=false
Type=Application
Icon=jupyter.svg
Categories=GNOME;GTK;