Skip to content

Instantly share code, notes, and snippets.

View gui11aume's full-sized avatar

Guillaume Filion gui11aume

View GitHub Profile
@gui11aume
gui11aume / keybase.md
Created September 20, 2023 19:40
My Keybase ID

Keybase proof

I hereby claim:

  • I am gui11aume on github.
  • I am gui11aume (https://keybase.io/gui11aume) on keybase.
  • I have a public key ASDeW2QwPKo7tz4agZTkx6J59wIpY8vGqpenXolBI1k7Kgo

To claim this, I am signing this object:

@gui11aume
gui11aume / keybase.md
Created September 20, 2023 19:26
My Keybase ID

Keybase proof

I hereby claim:

  • I am gui11aume on github.
  • I am gui11aume (https://keybase.io/gui11aume) on keybase.
  • I have a public key ASDeW2QwPKo7tz4agZTkx6J59wIpY8vGqpenXolBI1k7Kgo

To claim this, I am signing this object:

@gui11aume
gui11aume / train-encoder-decoder.py
Created September 6, 2021 02:17
Train an encoder-decoder
#!/usr/bin/ env python
# -*- coding:utf-8 -*-
"""
TOKENIZERS_PARALLELISM=false python golong.py
python 3.8.10
pytorch 1.9.0
transformers 4.10.0.dev0
"""
@gui11aume
gui11aume / pretrain-longformer.py
Created August 31, 2021 18:06
Pre train Longformer model on custom text
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
python 3.8.10
pytorch 1.9.0
transformers 4.10.0.dev0
"""
import transformers
@gui11aume
gui11aume / train-titles.py
Created August 20, 2021 12:32
Training script for custom MLM with 🤗 Transformers on a single GPU
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
'''
python 3.8.10
pytorch 1.9.0
transformers 4.10.0.dev0
'''
import torch
@gui11aume
gui11aume / train-imdb.py
Last active August 20, 2021 12:31
Training script for text classification with 🤗 Transformers on a single GPU
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
'''
python 3.8.10
pytorch 1.9.0
transformers 4.10.0.dev0
'''
import torch
@gui11aume
gui11aume / simple_rnn.py
Last active August 18, 2018 13:48
simple_rnn
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import numpy as np
import sys
def softmax(x):
e = np.exp(x - np.max(x))
return e / e.sum()
@gui11aume
gui11aume / learn_bwt_indexing_compression.c
Last active February 13, 2021 22:19
Learn Burrows-Wheeler indexing (compression)
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct occ_t { uint32_t bits; uint32_t smpl; };
typedef struct occ_t occ_t;
#define L 14 // Length of the text.
#define L4 ((L+3) / 4 ) // Length down-sampled 4 times.
@gui11aume
gui11aume / learn_bwt_indexing_vanilla.c
Last active February 13, 2021 21:35
Learn Burrows-Wheeler indexing (vanilla)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define L 14 // Length of the text.
// Global variables.
char TXT[L] = "GATGCGAGAGATG$";
int SA[L] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13};
char BWT[L] = {0};