Skip to content

Instantly share code, notes, and snippets.

View philipphager's full-sized avatar

Philipp Hager philipphager

View GitHub Profile
@philipphager
philipphager / AdjacencyList.java
Last active June 7, 2019 08:12
Simple GraphJet
package segments;
import java.util.*;
public class AdjacencyList {
private static final int[] NODE_THRESHOLDS;
static {
NODE_THRESHOLDS = new int[32];
NODE_THRESHOLDS[0] = 0;
public class ReservoirSampler {
private final Random random;
private final int[] buffer;
private int writePosition;
private int readPosition;
public ReservoirSampler(int size) {
this.random = new Random();
this.buffer = new int[size];
this.writePosition = 0;
subject predicate object
confluent achieve holy grail
telegram add unsend
avast think ccleaner
google release tez
odis bring alexa
microsoft ventures back illusive networks
elon musk exit trump
sherpa turn instagram
at&t make directv
@philipphager
philipphager / BipartiteGraph.java
Last active May 15, 2019 06:16
Basic Twitter SALSA implementation
import java.util.*;
public class BipartiteGraph {
private final Map<String, List<String>> leftToRight;
private final Map<String, List<String>> rightToLeft;
public BipartiteGraph() {
leftToRight = new HashMap<>();
rightToLeft = new HashMap<>();
}
@philipphager
philipphager / party.json
Created May 11, 2019 18:21
German Parlament Topic Data
[{"party": "spd", "members": 202, "topics": {"0": 0.04462631894897639, "1": 0.030298982545961035, "2": 0.17560700611761895, "3": 0.07978005520624103, "4": 0.06723973581172867, "5": 0.021756432741495146, "6": 0.07281972205872525, "7": 0.035198775544720784, "8": 0.026206746343589337, "9": 0.02015431514225945, "10": 0.035853569520036585, "11": 0.017522608807300777, "12": 0.04836807339928674, "13": 0.047162954414010166, "14": 0.046806188449461, "15": 0.031334624906131224, "16": 0.05220294282744657, "17": 0.04109634543171888, "18": 0.05632319260162189, "19": 0.049641409181670156}}, {"party": "gruene", "members": 71, "topics": {"0": 0.026971855540870796, "1": 0.03418054494600681, "2": 0.15935268364146812, "3": 0.08136658732358806, "4": 0.10041029331399118, "5": 0.0298567596122006, "6": 0.0781907882024178, "7": 0.045431686522771395, "8": 0.034542157803550244, "9": 0.024057724547168178, "10": 0.030199740713313643, "11": 0.019034640058956335, "12": 0.05824091447543428, "13": 0.04317808518648628, "14": 0.03046647467726
@philipphager
philipphager / word-2-vec-prime.config
Last active May 7, 2019 07:51
Word2Vec Embedding for Prime Video Dataset
{
"embeddings": [
{
"tensorName": "My tensor",
"tensorShape": [
26352,
100
],
"tensorPath": "https://gist.githubusercontent.com/philipphager/8efbce1b26b34249a6e6ebe7233ee6fd/raw/037b49bede0fd17e598469e1cd8d46ca229028ea/word-2-vec-tensor.tsv",
"metadataPath": "https://gist.githubusercontent.com/philipphager/d606e5185dd45d8cf3afa39709717eff/raw/2be669e6629ea6bf40d78de4108efb5827088b4d/word-2-vec-meta.tsv"
@philipphager
philipphager / word-2-vec-meta.tsv
Created May 7, 2019 07:36
Word2Vec Embedding for Prime Video Dataset
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
appeal
big
boring
detective
english
expectation
guy
investigative
love
particular
@philipphager
philipphager / word-2-vec-tensor.tsv
Last active May 7, 2019 07:48
Word2Vec Embedding for Prime Video Dataset
We can't make this file beautiful and searchable because it's too large.
-0.045706913 0.30585727 -0.035342585 0.073817454 0.027168615 -0.007677051 -0.12477071 -0.13671759 -0.028741503 -0.06406718 -0.09465194 0.18167421 0.024413325 -0.035261717 -0.123358406 -0.028613098 0.006569881 0.096095264 0.0537913 0.07545384 0.0028597992 0.066315554 0.02318037 0.018929208 -0.10739591 0.13760614 -0.13718557 0.020370366 0.020194191 -0.051938593 -0.105849706 0.07474335 0.013643867 -0.13587312 -0.06226042 0.1404782 -0.006735392 -0.11090239 0.09764515 0.11872706 -0.12148369 0.19498137 0.06430403 0.068087794 0.29772076 0.13119532 0.04606703 -0.13092415 0.13915189 0.074174196 -0.06321168 0.14663415 -0.08537185 -0.18759735 0.12143317 0.01708801 -0.11909505 -0.05818373 0.05620106 -0.15173313 0.04383486 0.18599313 0.06545563 -0.04472025 0.056377266 0.009878585 -0.0128651345 -0.1316982 -0.060614653 -0.033385176 0.02585074 0.043304265 -0.06635272 0.1069556 0.08209329 -0.13574818 -0.21313773 -0.01548819 -0.029777387 0.062272582 -0.04779019 0.030823868 -0.07995703 0.048718106 0.0078293355 0.13999689 -0.078
@philipphager
philipphager / prime.config
Last active May 6, 2019 14:09
Settings file for projector.tensorflow.org for Prime Video Dataset
{
"embeddings": [
{
"tensorName": "My tensor",
"tensorShape": [
1000,
50
],
"tensorPath": "https://gist.githubusercontent.com/philipphager/47cb4a11d3a1d90798be42231d6b3bca/raw/df4d31a01210f79128ed0faf9d70287fe17319e8/prime-tensor.tsv",
"metadataPath": "https://gist.githubusercontent.com/philipphager/0eb7107308edd04b109b59befa2c299b/raw/85346f36c23ac4e238ca1700ee845f9117dd2926/prime-meta.tsv"
@philipphager
philipphager / prime-meta.tsv
Created May 6, 2019 14:01
Fasttext Embedding for Prime Video Reviews
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
follower
crisis
timid
tryst
watchman
annis
dichotomy
pumping
righting
matching