MacBook Air (M1, 2020)
$ /opt/homebrew/bin/python3 -c 'import platform; print(platform.platform())'
macOS-11.4-arm64-arm-64bit
# Eternal bash history. | |
# --------------------- | |
# Undocumented feature which sets the size to "unlimited". | |
# http://stackoverflow.com/questions/9457233/unlimited-bash-history | |
export HISTFILESIZE= | |
export HISTSIZE= | |
export HISTTIMEFORMAT="[%F %T] " | |
# Change the file location because certain bash sessions truncate .bash_history file upon close. | |
# http://superuser.com/questions/575479/bash-history-truncated-to-500-lines-on-each-login | |
export HISTFILE=~/.bash_eternal_history |
//============================================================== | |
// Copyright © 2022 Intel Corporation | |
// | |
// SPDX-License-Identifier: MIT | |
// ============================================================= | |
#include <iostream> | |
#include <sycl/sycl.hpp> | |
#include <chrono> |
set -g mouse on | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix |
import torch | |
import time | |
import numpy as np | |
from torch import mps, cuda | |
num_trails = 10 | |
def flops_benchmark(device): | |
test_range = 2 ** np.arange(8, 13, 0.25) |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
arch -x86_64 zsh
nvm install --lts
"""Convert jupyter notebook to sphinx gallery notebook styled examples. | |
Usage: python ipynb_to_gallery.py <notebook.ipynb> | |
Dependencies: | |
pypandoc: install using `pip install pypandoc` | |
""" | |
import pypandoc as pdoc | |
import json |
import numpy as np | |
from scipy.ndimage.interpolation import map_coordinates | |
from scipy.ndimage.filters import gaussian_filter | |
def elastic_transform(image, alpha, sigma, random_state=None): | |
"""Elastic deformation of images as described in [Simard2003]_. | |
.. [Simard2003] Simard, Steinkraus and Platt, "Best Practices for | |
Convolutional Neural Networks applied to Visual Document Analysis", in |
require 'image' | |
function ElasticTransform(img, alpha, sigma) | |
--[[ | |
Parameters | |
---------- | |
img: Tensor of size KxHxW | |
Image on which elastic transformation have to be applied | |
alpha: number | |
Intensity of the transformation |
import numpy as np | |
from skimage import io | |
from skimage import transform | |
import matplotlib.pyplot as plt | |
import math | |
import time | |
I = io.imread('random_img.jpg') | |
# Homography |