Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
is slow.

Shuhao Cao scaomath

🐢
is slow.
View GitHub Profile
View FLOPs_mlp.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scaomath
scaomath / einsum.md
Created Jul 6, 2021
Einstein sum reference
View einsum.md

Einstein sum refs

Copied from torch's linear algebra test file.

Vector operations

torch.einsum('i->', x)                     # sum
torch.einsum('i,i->', x, x)                # dot
torch.einsum('i,i->i', x, x)               # vector element-wisem mul
torch.einsum('i,j->ij', x, y)              # outer
@scaomath
scaomath / jekyll_custom.md
Last active Jun 17, 2021
Jekyll simple workflow to use custom a plugin on Github pages
View jekyll_custom.md

Jekyll simple workflow to use custom a plugin on Github pages

Workflow

Mainly following Alexandre Rademaker's guide.

  • Checkout to source branch, where we write things with a custom plugin.
git checkout source
  • Writing things, commit and push the changes
@scaomath
scaomath / git-rinse.md
Created Apr 14, 2021
Hard reset submodules
View git-rinse.md
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@scaomath
scaomath / scribbling.md
Last active Jun 1, 2021
Survive as a grad student in scientific computing
View scribbling.md

Survive as a grad student in scientific computing

GitHub 101

Git

What is version control? Most jargons in Git have "literal" meanings.

  • pull, commit, push
  • worktree
  • branch, pull request, merge, comments
@scaomath
scaomath / nninterface.h
Created Nov 21, 2020
To do: modify this interface for ROCm
View nninterface.h
#ifndef NEURALNET_NNINTERFACE_H_
#define NEURALNET_NNINTERFACE_H_
#include "../core/global.h"
#include "../core/commontypes.h"
#include "../core/hash.h"
#include "../core/logger.h"
#include "../neuralnet/desc.h"
#include "../neuralnet/nninputs.h"
@scaomath
scaomath / keybindings.json
Last active Nov 12, 2020
VS Code key bindings for shortcuts on Ubuntu Linux to mimic MacOS behavior
View keybindings.json
// On Ubuntu Linux mimic MacOS keybindings on Logitech MX Keys
// where the layout is slightly different to incorporate both MacOS and Linux into one keyboard
// after customized key mapping: ctrl is mapped to alt; alt is mapped to win; (meta is mapped to ctrl)
// in /etc/default/keyboard: XKBOPTIONS="altwin:ctrl_alt_win"
//
[
{
"key": "ctrl+left",
"command": "cursorHome",
"when": "textInputFocus"
@scaomath
scaomath / settings.json
Last active Jun 1, 2021
My VS Code setting file
View settings.json
{ "[latex]": {
"editor.formatOnPaste": false,
"editor.suggestSelection": "recentlyUsedByPrefix",
"editor.autoIndent": "none"
},
"[tex]": {
"editor.formatOnPaste": false,
"editor.suggestSelection": "recentlyUsedByPrefix",
"editor.autoIndent": "none"
},