Skip to content

Instantly share code, notes, and snippets.

View pangjh3's full-sized avatar
🎯
Focusing

Pang Jianhui pangjh3

🎯
Focusing
View GitHub Profile
@vadimkantorov
vadimkantorov / compact_bilinear_pooling.py
Last active September 22, 2021 07:51
Compact Bilinear Pooling in PyTorch using the new FFT support
# References:
# [1] Multimodal Compact Bilinear Pooling for Visual Question Answering and Visual Grounding, Fukui et al., https://arxiv.org/abs/1606.01847
# [2] Compact Bilinear Pooling, Gao et al., https://arxiv.org/abs/1511.06062
# [3] Fast and Scalable Polynomial Kernels via Explicit Feature Maps, Pham and Pagh, https://chbrown.github.io/kdd-2013-usb/kdd/p239.pdf
# [4] Fastfood — Approximating Kernel Expansions in Loglinear Time, Le et al., https://arxiv.org/abs/1408.3060
# [5] Original implementation in Caffe: https://github.com/gy20073/compact_bilinear_pooling
# TODO: migrate to use of new native complex64 types
# TODO: change strided x coo matmul to torch.matmul(): M[sparse_coo] @ M[strided] -> M[strided]
@noisychannel
noisychannel / moses-built-ttable.sh
Created April 23, 2015 21:58
MOSES : Build phrase table
#!/usr/bin/env bash
# Change these variables
ROOT_DIR=/export/a04/gkumar/experiments/scale-2015/1
EXTERNAL_BIN_DIR=/export/a04/gkumar/code/mosesdecoder/tools
F_EXT=pa
E_EXT=en
MAX_PHRASE_LENGTH=10
CORPUS=/export/a04/gkumar/experiments/scale-2015/data/trans