Skip to content

Instantly share code, notes, and snippets.

View dokato's full-sized avatar

dokato

  • University of Cambridge
  • Cambridge, UK
View GitHub Profile
@dokato
dokato / orthogonalization.py
Created February 15, 2018 14:13
Find closest orthogonal matrix
import numpy as np
def find_closest_orthogonal_matrix(A):
'''
Find closest orthogonal matrix to *A* using iterative method.
Bases on the code from REMOVE_SOURCE_LEAKAGE function from OSL Matlab package.
Args:
A (numpy.array): array shaped k, n, where k is number of channels, n - data points
@dokato
dokato / parcellation_visualization.py
Last active January 11, 2018 16:43
Visualization of brain regions after FreeSurfer parcellation
from __future__ import print_function
import os
import numpy as np
from surfer import Brain
from mayavi import mlab
import nibabel as nib
subjects_folder = os.environ["SUBJECTS_DIR"]
@dokato
dokato / fashionmnist.R
Last active June 27, 2023 12:27
Fashion-MNIST in R starter
library(readr)
library(keras)
# By Dominik Krzeminski (dokato)
#' Data downloaded from https://www.kaggle.com/zalando-research/fashionmnist
#' More information is at the ZalandoResearch GitHub:
#' https://github.com/zalandoresearch/fashion-mnist
train.data <- read_csv("fashion-mnist_train.csv",
col_types = cols(.default = "i"))