This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"private_outputs": true, | |
"provenance": [], | |
"gpuType": "T4" | |
}, | |
"kernelspec": { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
""" | |
Convert IMDB META data(matlab .mat) to csv. | |
IMDB-WIKI – 500k+ face images with age and gender labels | |
- https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/ | |
- https://stackoverflow.com/questions/13965740/converting-matlabs-datenum-format-to-python | |
""" | |
from datetime import datetime, timedelta |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Compare all files in the first directory with those of the second directory | |
dir1=src1/ # 1st Directory | |
dir2=src2/ # 2nd Directory | |
fpaths=${dir1}* # Fetch all file paths in the 1st directory | |
# Loop for all files | |
i=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data { | |
int N; | |
vector[N] x; | |
vector[N] y; | |
} | |
parameters { | |
real<lower=0> a; | |
real<lower=0> phi; // variance of gamma | |
real<lower=0> b0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simulate exponential data / gamma distribution with stan | |
library(rstan) | |
library(tidyverse) | |
options(mc.cores = parallel::detectCores()) | |
rstan_options(auto_write = TRUE) | |
# ----------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import numpy as np | |
import pandas as pd | |
import seaborn as sns | |
x = [1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 6] | |
fig, ax = plt.subplots() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""AR(1) Process Simulation """ | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from statsmodels.graphics.tsaplots import plot_acf | |
def gen_ar1(phi, N=1000): | |
"""Simulate AR(1) process""" | |
Z = np.random.normal(0, 1, N) # Gaussian W.N. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Convertace article with TEX syntax with Hatena Blog Syntax """ | |
import os | |
import re | |
from typing import List, Callable | |
from copy import deepcopy | |
def replace_m(x: str, rep_map: List[dict]) -> str: | |
for pattern, repl in rep_map: | |
x = x.replace(pattern, repl) |
NewerOlder