Skip to content

Instantly share code, notes, and snippets.

View roflmaostc's full-sized avatar
😕
Worried about climate change

Felix Wechsler roflmaostc

😕
Worried about climate change
View GitHub Profile
@mkitti
mkitti / napari.jl
Last active December 28, 2020 19:31
Invoking Napari from Julia Language 1.3.1
"""
napari.jl
Test using PyCall.jl to invoke Napari ( http://github.com/napari ) from
the Julia language ( https://julialang.org/ ) 1.3.1
Mark Kittisopikul
January 29th, 2020
"""
@Kulbear
Kulbear / interpolate3d.py
Created June 21, 2022 22:29
Trilinear interpolation on a 3D regular grid, implemented with PyTorch.
import tensorflow as tf
import torch
import numpy as np
def gather_nd_torch(params, indices, batch_dim=1):
""" A PyTorch porting of tensorflow.gather_nd
This implementation can handle leading batch dimensions in params, see below for detailed explanation.
The majority of this implementation is from Michael Jungo @ https://stackoverflow.com/a/61810047/6670143
I just ported it compatible to leading batch dimension.