Skip to content

Instantly share code, notes, and snippets.

@nmwsharp
nmwsharp / printarr
Last active October 7, 2025 13:57
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc. --- now on pip: `pip install arrgh`
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc.
Now on pip! `pip install arrgh` https://github.com/nmwsharp/arrgh
@Pusnow
Pusnow / CS 분야 우수 학술대회 목록.csv
Last active December 8, 2025 05:34
CS 분야 우수 학술대회 목록
약자 한국정보과학회 (2024) BK21플러스 IF (2018) KAIST CS (2022) SNU CSE (2024.4) POSTECH CSE (2024.9) 평균 (정규화) 학회명 DBLP Key
AAAI 최우수 4 O O 최우수 1.00 AAAI Conference on Artificial Intelligence (AAAI) conf/aaai
AAMAS 우수 2 0.20 International Conference on Autonomous Agents and Multiagent Systems (AAMAS) conf/ifaamas
ACCV 우수 1 우수 0.25 Asian Conference on Computer Vision (ACCV) conf/accv
ACL 최우수 4 O O 최우수 1.00 Annual Meeting of the Association for Computational Linguistics (ACL) conf/acl
ACL Findings 우수 우수 0.20 Findings of ACL series/findacl
ACNS 우수 0.10 International Conference on Applied Cryptography and Network Security (ACNS) conf/acns
ACSAC 우수 2 우수 0.30 Annual Computer Security Applications Conference (ACSAC) conf/acsac
AIED 우수 0.10 International Conference on Artificial Intelligence in Education (AIED) conf/aied
AISTATS 우수 1 우수 0.25 International Conference on Artificial Intelligence and Statistics (AISTATS) conf/aistats
@dsevero
dsevero / gumbel-softmax-trick.py
Last active January 5, 2025 07:16
Gumbel-Softmax Trick
# We can produce samples from an un-normalized distribution by adding
# iid Gumbel noise together with the argmax operator; which is denoted as the Gumbel-Max Trick.
# However, argmax doesn't produce meaningful gradient signals, so we replace argmax
# by softmax, with a temperature parameter (Gumbel-Softmax Trick).
#
# I didn't invent any of this, all credit goes to the following papers:
# - https://arxiv.org/abs/1611.00712
# - https://arxiv.org/abs/1611.01144
import numpy as np
'''
This file is heavily inspired by https://github.com/j-towns/ans-notes/blob/master/rans.py
We describe a variant of bits-back coding called BB-Huffman. This file is meant
purely as an educational tool and is in no way optimized. The goals are to
1. illustrate how bits-back coding can be used with Huffman-like codecs;
2. and how the cost of using a selector to toggle between codebooks can be greatly reduced.
- Symbols are integers between 0 and 2;
@Nikolaj-K
Nikolaj-K / category_theory_literature.md
Last active December 2, 2025 19:03
Recomended reading for the undergrad category theorist
@rwightman
rwightman / median_pool.py
Last active August 13, 2024 10:57
PyTorch MedianPool (MedianFilter)
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair, _quadruple
class MedianPool2d(nn.Module):
""" Median pool (usable as median filter when stride=1) module.
from graphviz import Digraph
import torch
from torch.autograd import Variable, Function
def iter_graph(root, callback):
queue = [root]
seen = set()
while queue:
fn = queue.pop()
if fn in seen:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active December 8, 2025 01:11
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

A Tour of PyTorch Internals (Part I)

The fundamental unit in PyTorch is the Tensor. This post will serve as an overview for how we implement Tensors in PyTorch, such that the user can interact with it from the Python shell. In particular, we want to answer four main questions:

  1. How does PyTorch extend the Python interpreter to define a Tensor type that can be manipulated from Python code?
  2. How does PyTorch wrap the C libraries that actually define the Tensor's properties and methods?
  3. How does PyTorch cwrap work to generate code for Tensor methods?
  4. How does PyTorch's build system take all of these components to compile and generate a workable application?

Extending the Python Interpreter

PyTorch defines a new package torch. In this post we will consider the ._C module. This module is known as an "extension module" - a Python module written in C. Such modules allow us to define new built-in object types (e.g. the Tensor) and to call C/C++ functions.

@lvzongting
lvzongting / wget-gdrive.sh
Last active March 30, 2025 08:56
download google drive file only with wget 仅通过wget 在bash命令行下载谷歌网盘(狗哥网盘)上的文件
#reference https://unix.stackexchange.com/questions/136371/how-to-download-a-folder-from-google-drive-using-terminal
#get cookie and code
wget --save-cookies cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/Code: \1\n/p'
#download the file
wget --load-cookies cookies.txt 'https://docs.google.com/uc?export=download&confirm=CODE_FROM_ABOVE&id=FILEID'