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 | |
import matplotlib.pyplot as plt | |
# ensure your arr is sorted from lowest to highest values first! | |
arr = np.array([1,4,6,9,100]) | |
def gini(arr): | |
count = arr.size | |
coefficient = 2 / count | |
indexes = np.arange(1, count + 1) |
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
class Ralamb(Optimizer): | |
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0): | |
defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay) | |
self.buffer = [[None, None, None] for ind in range(10)] | |
super(Ralamb, self).__init__(params, defaults) | |
def __setstate__(self, state): | |
super(Ralamb, self).__setstate__(state) |
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 | |
import os | |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' | |
import sys | |
import torch | |
import numpy as np | |
import tensorflow as tf | |
from time import perf_counter |
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
FROM jupyter/pyspark-notebook | |
USER root | |
# Add essential packages | |
RUN apt-get update && apt-get install -y build-essential curl git gnupg2 nano apt-transport-https software-properties-common | |
# Set locale | |
RUN apt-get update && apt-get install -y locales \ | |
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ | |
&& locale-gen | |
# Add config to Jupyter notebook | |
COPY jupyter/jupyter_notebook_config.py /home/jovyan/.jupyter/ |
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 | |
set -e | |
# specify your MFA_DEVICE_ARN | |
MFA_DEVICE_ARN=YOURMFAARN | |
PATH_TO_CREDENTIALS_FILE=/path/to/.aws/credentials | |
echo $PATH_TO_CREDENTIALS_FILE | |
#1H = 3600 | |
#2H = 7200 | |
#3H = 10800 |
OlderNewer