- Log in to AWS
- Go to a sensible region
- Start a new instance with Ubuntu Trusty (14.04) - compute-optimised instances have a high vCPU:memory ratio, and the lowest-cost CPU time.
c4.2xlarge
is a decent choice. - Set security group (firewall) to have ports 22, 80, and 443 open (SSH, HTTP, HTTPS)
- If you want a static IP address (for long-running instances) then select Elastic IP for this VM
- If you want to use HTTPS, you'll probably need a paid certificate, or to use Amazon's Route 53 to get a non-Amazon domain (to avoid region blocking).
import pandas as pd | |
def rsi(ohlc: pd.DataFrame, period: int = 14) -> pd.Series: | |
"""See source https://github.com/peerchemist/finta | |
and fix https://www.tradingview.com/wiki/Talk:Relative_Strength_Index_(RSI) | |
Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. | |
RSI oscillates between zero and 100. Traditionally, and according to Wilder, RSI is considered overbought when above 70 and oversold when below 30. | |
Signals can also be generated by looking for divergences, failure swings and centerline crossovers. |
class TokenizeLookupLayer(keras.layers.Layer): | |
""" | |
Layer that encapsulates the following: | |
- Tokenizing sentences by space (or given delimiter) | |
- Looking up the words with a given vocabulary list / table | |
- Resetting the shape of the above to be batch_size x pad_len (using dark magic) | |
# Input Shape | |
2D string tensor with shape `(batch_size, 1)` | |
# Output Shape | |
2D int32 tensor with shape `(batch_size, pad_len)` |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
The Batch Normalization paper describes a method to address the various issues related to training of Deep Neural Networks. It makes normalization a part of the architecture itself and reports significant improvements in terms of the number of iterations required to train the network.
Covariate shift refers to the change in the input distribution to a learning system. In the case of deep networks, the input to each layer is affected by parameters in all the input layers. So even small changes to the network get amplified down the network. This leads to change in the input distribution to internal layers of the deep network and is known as internal covariate shift.
It is well established that networks converge faster if the inputs have been whitened (ie zero mean, unit variances) and are uncorrelated and internal covariate shift leads to just the opposite.
# http://www.dataiku.com/blog/2015/08/24/xgboost_and_dss.html | |
import dataiku | |
import pandas as pd, numpy as np | |
from dataiku import pandasutils as pdu | |
from sklearn.metrics import roc_auc_score | |
import xgboost as xgb | |
from hyperopt import hp, fmin, tpe, STATUS_OK, Trials | |
train = dataiku.Dataset("train").get_dataframe() |
This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.
Install Raspbian Jessie (2016-05-27-raspbian-jessie.img
) to your Pi's sdcard.
Use the Raspberry Pi Configuration tool or sudo raspi-config
to:
Start a g2.2xlarge or better (GPU instance) with https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-ffba7b94 | |
Login, username is ubuntu | |
Update a bunch of stuff and make sure cudnn R2 is used: | |
luarocks install image | |
luarocks install loadcaffe | |
luarocks install torch | |
export LD_LIBRARY_PATH=/home/ubuntu/torch-distro/install/lib:/home/ubuntu/torch-distro/install/lib:/home/ubuntu/cudnn-6.5-linux-x64-v2-rc2 |
Someone asked how to get the latlong from a specific road near a town on OpenStreetMap.
If you need to do it only once (e.g., you're about to go on a trip, and your GPS cannot find your destination city, but allows you to enter GPS coordinates), you can use Nominatim, OpenStreetMap's geocoding interface.
If you need to do it multiple times, in a programmatic manner, there are at least two ways to do that.
Note: I worked with OSM data a couple of years ago, but I don't have an OSM database on my local laptop right now, so some instructions will be a bit fuzzy. I do apologize in advance.