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 | |
## usage: | |
## cluster-cmd.sh <-h hosts_file> [-u user] cmd | |
## cluster-cmd.sh -h hosts ls -la | |
function usage() | |
{ | |
echo "usage : $0 -h <hosts file> [-u user] [-i ssh_key_file] cmd" | |
exit 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
#!/bin/bash | |
if [ -z "$1" ] ; then | |
echo "Usage: $0 <image name> [optional args for docker image]" | |
echo "Missing Docker image id. exiting" | |
exit 1 | |
fi | |
#image_id="$1" | |
#shift |
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 | |
## invoke with '-d' for dev mode | |
## this will mount utils directory from host for live debugging | |
port=2000 | |
while getopts 'dp:' OPTION; do | |
case "$OPTION" in | |
d) |
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 | |
## This CNN network to identify MNIST dataset | |
import time | |
import random | |
import numpy as np | |
from pprint import pprint | |
import os, sys |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading models... | |
Loaded model 'transformer-qa' in 31,693.4 milli seconds | |
Loaded model 'bidaf-model' in 1,633.8 milli seconds | |
/Users/sujee/opt/anaconda3/envs/teachbot-nlp/lib/python3.7/site-packages/torch/nn/modules/container.py:435: UserWarning: Setting attributes on ParameterList is not supported. | |
warnings.warn("Setting attributes on ParameterList is not supported.") | |
Loaded model 'bidaf-elmo-model' in 13,811.0 milli seconds | |
quesion: Who stars in The Matrix? | |
model transformer-qa predicted in 794.4 milli seconds | |
answer: Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving, and Joe Pantoliano |
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
## Step 3 : encode the indexes into a vector | |
from pyspark.ml.feature import OneHotEncoder | |
encoder = OneHotEncoder(inputCols=["statusIndex"], outputCols=["statusVector"], dropLast=False) | |
encoded = encoder.fit(indexed).transform(indexed) | |
encoded.show() | |
# View dense vectors in pandas | |
encoded_pd = encoded.toPandas() | |
print(encoded_pd) |
OlderNewer