- Install rosetta2
- Install NVM using instructions here
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
- Add the stuff from the above command to zshrc to initialize nvm
- Go to x86 shell by
arch -x86_64 zsh
- Install lts node using nvm in the intel shell:
nvm install --lts
- Enjoy node in all shells (x86 or arm)
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 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 |
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
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 |
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 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 |
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
"""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 |
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 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) |
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
set -g mouse on | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix |
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
//============================================================== | |
// Copyright © 2022 Intel Corporation | |
// | |
// SPDX-License-Identifier: MIT | |
// ============================================================= | |
#include <iostream> | |
#include <sycl/sycl.hpp> | |
#include <chrono> |
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
# 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 |