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 time | |
import math | |
def burn_cpu(): | |
a = np.random.rand(1024, 1024) | |
b = np.random.rand(1024, 1024) | |
tic = time.time() | |
c = np.dot(a, b) | |
toc = time.time() |
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
apt update | |
apt install -y emacs-nox aptitude screen xcscope-el gdb nano || echo 0 && echo "Success" | |
python3 -m pip install git-remote-codecommit opennmt-tf==1.25.1 | |
cat << EOF > ~/.gdbinit | |
set print thread-events off | |
define hook-run | |
catch throw | |
end | |
define hook-quit |
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/sh | |
ProgName=$(basename $0) | |
instance_ids=i-05806fb95d65fffff | |
region=us-west-2 | |
sub_help(){ | |
echo "Usage: $ProgName <subcommand> [options]\n" | |
echo "Subcommands:" | |
echo " start Start mldev instances" |
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
# Benchmark inference time of pretrained AutoGluon Tabular models | |
""" | |
set -e | |
DEV_BRANCH=reset-thread-2 | |
git checkout master | |
/opt/conda/envs/py38/bin/python3 example_dev_tabular.py --sample=1 | |
/opt/conda/envs/py38/bin/python3 example_dev_tabular.py | |
git checkout $DEV_BRANCH | |
/opt/conda/envs/py38/bin/python3 example_dev_tabular.py --sample=1 | |
/opt/conda/envs/py38/bin/python3 example_dev_tabular.py |
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
""" Example script for defining and using custom models in AutoGluon Tabular """ | |
from autogluon.core.utils import infer_problem_type | |
from autogluon.tabular import TabularDataset, TabularPredictor | |
from autogluon.tabular.configs.hyperparameter_configs import get_hyperparameter_config | |
from autogluon.core.data import LabelCleaner | |
from autogluon.core.models import AbstractModel | |
from skl2onnx import convert_sklearn, get_model_alias | |
from skl2onnx.common._registration import get_shape_calculator, get_converter |
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
#include <stdio.h> | |
#include <inttypes.h> | |
static const uint32_t kSingleSignMask = 0x80000000; | |
static const uint32_t kSingleExpMask = 0x7f800000; | |
static const uint32_t kSingleMantMask = 0x007fffff; | |
static const uint32_t kHalfSignMask = 0x8000; | |
static const uint32_t kHalfExpMask = 0x7c00; | |
static const uint32_t kHalfMantMask = 0x03ff; |
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
# Inspired by https://keon.io/deep-q-learning/ | |
# python3 -m pip install keras==2.3.1 tensorflow-gpu==1.15 gym==0.18.3 | |
# python3 -m pip install 'h5py==2.10.0' --force-reinstall | |
import random | |
import gym | |
import math | |
import numpy as np | |
import keras |
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 boto3 | |
def recursive_copy(src_bucket, src_prefix, dst_bucket, dst_prefix): | |
def get_partition(): | |
if boto3.session.Session().region_name in ["cn-northwest-1", "cn-north-1"]: | |
return "aws-cn" | |
else: | |
return "aws" | |
partition = get_partition() | |
region_name = boto3.session.Session().region_name |
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 random | |
random.seed(111) | |
def bosonnlp_to_bio2(origfile, trainfile, valfile): | |
val_ratio = 0.2 | |
traindata = [] | |
valdata = [] | |
with open(origfile, 'rt') as fp: |
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
{ | |
creator: "Yosys 0.5+220 (git sha1 94fbaff, emcc -Os)", | |
modules: { | |
VTAShell: { | |
ports: { | |
io_host_r: { | |
direction: "output", | |
bits: [ | |
0 | |
] |
NewerOlder