Skip to content

Instantly share code, notes, and snippets.

View Jabb0's full-sized avatar

Felix Jabb0

View GitHub Profile
@pcyin
pcyin / log_sum_exp.py
Created September 7, 2018 14:29
Pytorch masked `log_sum_exp`
def log_sum_exp(inputs, keepdim=False, mask=None):
"""Numerically stable logsumexp on the last dim of `inputs`.
reference: https://github.com/pytorch/pytorch/issues/2591
Args:
inputs: A Variable with any shape.
keepdim: A boolean.
mask: A mask variable of type float. It has the same shape as `inputs`.
**ATTENTION** invalid entries are masked to **ONE**, not ZERO
Returns:
Equivalent of log(sum(exp(inputs), keepdim=keepdim)).
@holmberd
holmberd / deploy-keys.md
Last active February 11, 2024 20:36
Setup GitHub repository SSH deploy keys

Setup GitHub repository SSH deploy keys

  1. Create GitHub repository in github and save the SSH repository url

  2. Init git on server in code directory

  • git init
  1. Create SSH keys on the server
  • ssh-keygen -t rsa -b 4096 -C your@email.here
  • Rename the key that doesn't end with .pub to repo-name.deploy.pem
@0xjac
0xjac / private_fork.md
Last active June 28, 2024 19:27
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git