Skip to content

Instantly share code, notes, and snippets.

View ekreutz's full-sized avatar
📖
Reading; Donald Knuth, of course.

Emil Kreutzman ekreutz

📖
Reading; Donald Knuth, of course.
View GitHub Profile
@ekreutz
ekreutz / attention.md
Last active August 4, 2024 15:01
Dot-product and Multi-head attention implementation in Tensorflow 2

Dot-product and Multi-head attention

Dot-product and Multi-head attention from the paper "Attention is all you need" (2017). Implementation in modern Tensorflow 2 using the Keras API.

Example use of the implementations below:

batch_size = 10
n_vectors = 150
d_model = 512
@ekreutz
ekreutz / tmux_conda_fix.md
Last active June 23, 2025 18:21
Fix tmux messing with conda path

Fix tmux messing with conda

Problem: When running a conda environment and opening tmux on macOS, a utility called path_helper is run again. Essentially, the shell is initialized twice which messes up the ${PATH} so that the wrong Python version shows up within tmux.

Solution

If using bash, edit /etc/profile and add one line. (For zsh, edit /etc/zprofile)

...
@ekreutz
ekreutz / ansible_variable_precedence.md
Last active May 28, 2025 08:13
Ansible variable precedence (order, hierarchy)
@ekreutz
ekreutz / resetXcode.sh
Last active February 28, 2018 20:00 — forked from maciekish/resetXcode.sh
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches
#!/bin/bash
#
# curl -O https://gist.githubusercontent.com/ekreutz/b245da335cc10b0d270136b35eb22d1f/raw/43c6d07b0b3d3165af9c10cef18e8709a07ce680/resetXcode.sh && bash ./resetXcode.sh ; rm ./resetXcode.sh
#
if [[ $(whoami) != jenkins ]]; then
echo "Run as jenkins"
exit 1
fi