First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel
Then ssh with root account, run this in termianl:
$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
ARG FUNCTION_RUNTIME | |
FROM mikesir87/aws-cli as code | |
ARG FUNCTION_NAME | |
ARG AWS_DEFAULT_REGION | |
ARG AWS_ACCESS_KEY_ID | |
ARG AWS_SECRET_ACCESS_KEY | |
RUN wget -O function.zip `aws lambda get-function --function-name $FUNCTION_NAME --query 'Code.Location' --output text` |
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/raid-config.html | |
nvmes=$(sudo lsblk | awk '/^nvme/ {printf "/dev/%s ", $1}') | |
sudo mdadm --create --verbose /dev/md0 --level=0 --name=my_raid --raid-devices=$(echo $nvmes | wc -w) $nvmes | |
sleep 10# crutch | |
sudo mkfs.ext4 -L my_raid /dev/md0 | |
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm.conf | |
sudo dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r) | |
sudo mkdir /data | |
sudo mount LABEL=my_raid /data | |
sudo chown ec2-user:ec2-user /data/ |
from __future__ import print_function | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torch.autograd import Variable | |
def sample_gumbel(shape, eps=1e-20): | |
U = torch.rand(shape).cuda() | |
return -Variable(torch.log(-torch.log(U + eps) + eps)) |
def sample_gumbel(shape, eps=1e-20): | |
"""Sample from Gumbel(0, 1)""" | |
U = tf.random_uniform(shape,minval=0,maxval=1) | |
return -tf.log(-tf.log(U + eps) + eps) | |
def gumbel_softmax_sample(logits, temperature): | |
""" Draw a sample from the Gumbel-Softmax distribution""" | |
y = logits + sample_gumbel(tf.shape(logits)) | |
return tf.nn.softmax( y / temperature) |
import numpy as np | |
import numba as nb | |
from numba import types | |
from numba.extending import overload_method | |
@overload_method(types.Array, 'take') | |
def array_take(arr, indices): | |
if isinstance(indices, types.Array): |
#!/bin/sh | |
BUCKETNAME=mybucketname; REGION=us-east-1; for prefix in $(aws s3api list-objects --bucket $BUCKETNAME --delimiter '/' --output text --region $REGION |grep COMMONPREFIX |tail -n+2| awk '{print $2}'); do echo "Totals for $prefix"; aws s3 ls --summarize --human-readable --recursive s3://$BUCKETNAME/$prefix --region $REGION ; done |grep Total |
# -*- coding: utf-8 -*- | |
# Authors: Olivier Grisel <[email protected]> | |
# Mathieu Blondel <[email protected]> | |
# Lars Buitinck <[email protected]> | |
# Robert Layton <[email protected]> | |
# Jochen Wersdörfer <[email protected]> | |
# Roman Sinayev <[email protected]> | |
# | |
# License: BSD 3 clause | |
""" |
disable_flush
and disable_recovery
(TD)require 'tire' | |
# Tire.configure { logger STDERR, level: 'debug' } | |
Tire.index('movie-titles') do | |
delete | |
create \ | |
settings: { | |
index: { | |
analysis: { |