Skip to content

Instantly share code, notes, and snippets.

View hanspinckaers's full-sized avatar

Hans Pinckaers hanspinckaers

View GitHub Profile
@hanspinckaers
hanspinckaers / derek.md
Last active May 3, 2021 07:42
Answers to Derek

Hi Derek!

Here are my answers between your questions:

>> First off I was wondering, how much benefit did you see from averaging the fine tuned models weights over the moving window of lowest validation loss?

I saw small improvements for every experiment (AUC +/- 0.01 to 0.07). I really believe averaging weights is important if you have a small validation set. A small set will result in a noisy validation loss / metric curve and thus be hard to choose the right checkpoint to evaluate on the test set. Here is an example from an experiment with a very small validation set (not from this paper):

@hanspinckaers
hanspinckaers / glas_metrics.py
Last active August 29, 2019 08:34
Metrics of GlaS challenge in python
import numpy as np
from scipy import stats
from sklearn.neighbors import NearestNeighbors
def ObjectHausdorff(S=None, G=None):
S = np.array(S).astype(np.uint8)
G = np.array(G).astype(np.uint8)
@hanspinckaers
hanspinckaers / .vimrc
Last active December 8, 2020 09:37
My full vimrc
syntax on
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree' " file list
Plug 'majutsushi/tagbar' " show tags in a bar (functions etc) for easy browsing
Plug 'vim-airline/vim-airline' " make statusline awesome
Plug 'vim-airline/vim-airline-themes' " themes for statusline
Plug 'jonathanfilip/vim-lucius' " nice white colortheme
Plug 'davidhalter/jedi-vim' " jedi for python
@hanspinckaers
hanspinckaers / parameters.diff
Created August 20, 2018 18:40
Iosevka parameters
@@ -9,9 +9,9 @@ designer = 'Belleve Invis'
description = 'Spatial efficient monospace font family for programming. Built from code. http://be5invis.github.io/Iosevka'
leading = 1250 # Default line height times 1000.
-descenderPad = 0 # Additional line height, added to descender.
-width = 500 # Character width. Increase this if you think that Iosevka is too narrow.
-cap = 735 # Cap height (as well as ascender).
+descenderPad = 70 # Additional line height, added to descender.
+width = 530 # Character width. Increase this if you think that Iosevka is too narrow.
+cap = 720 # Cap height (as well as ascender).
@hanspinckaers
hanspinckaers / vimrc.vim
Created August 20, 2018 18:36
Extra .vimrc highlight settings
" highlight attribute access: hello.highlighted
autocmd BufEnter * syntax match Type /\v\.[a-zA-Z0-9_]+\ze(\[|\s|$|,|\]|\)|\.|:)/hs=s+1
" highlight function calls: hello.highlighted()
autocmd BufEnter * syntax match pythonFunction /\v[[:alnum:]_]+\ze(\s?\()/
hi def link pythonFunction Function
" Highlight self slightly darker
autocmd BufEnter * syn match Self "\(\W\|^\)\@<=self\(\.\)\@="
highlight self ctermfg=239
" Extra Impsort highlights:
hi pythonImportedObject ctermfg=127
@hanspinckaers
hanspinckaers / vimrc.vim
Created August 20, 2018 18:33
Jedi-vim .vimrc settings
" Disable Jedi-vim autocompletion and enable call-signatures options
let g:jedi#auto_initialization = 1
let g:jedi#completions_enabled = 0
let g:jedi#auto_vim_configuration = 0
let g:jedi#smart_auto_mappings = 0
let g:jedi#popup_on_dot = 0
let g:jedi#completions_command = ""
let g:jedi#show_call_signatures = "1"
@hanspinckaers
hanspinckaers / vimrc.vim
Last active August 21, 2018 19:09
NCM2 .vimrc settings
" the relevant modules (add to plug-section if you already have one)
call plug#begin('~/.vim/plugged')
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2'
" Fast python completion (use ncm2 if you want type info or snippet support)
Plug 'HansPinckaers/ncm2-jedi'
" Words in buffer completion
Plug 'ncm2/ncm2-bufword'
" Filepath completion
Plug 'ncm2/ncm2-path'
@hanspinckaers
hanspinckaers / 1_ycm_speed_hacks.patch
Last active August 6, 2018 14:44
YCM and Jedi patches for faster Python completion, trade in type-information in completions for speed. Blog-post about my whole VIM setup coming soon.
From 49225f02ba22c79764e62c14d8f3747834e7547f Mon Sep 17 00:00:00 2001
From: Hans Pinckaers <hans.pinckaers@gmail.com>
Date: Mon, 6 Aug 2018 07:53:19 +0200
Subject: [PATCH] Do not request type information (is slow)
---
ycmd/completers/python/python_completer.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ycmd/completers/python/python_completer.py b/ycmd/completers/python/python_completer.py
@hanspinckaers
hanspinckaers / global.html
Last active November 7, 2016 06:27
Safari extension - inject a 'before' content script in current tab, indefinitely
<html>
<head>
<script type="text/javascript" charset="utf-8">
// I couldn't find another way to execute a before content script only in a certain Safari tab:
// using dispatching to before script only works in the event 'navigate', which is (imo) too slow for a before contentscript.
// placeholder for the generated content script filename
var currentScriptURL = "";
// set this variable to the tab in which you want to run the script