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
For small files | |
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=1rC6LWGNkHaZkuojCEWDqSKcDGwFMBTYZ' -O transformer_semeval.clf | |
For large files | |
wget --load-cookies cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1rC6LWGNkHaZkuojCEWDqSKcDGwFMBTYZ' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1rC6LWGNkHaZkuojCEWDqSKcDGwFMBTYZ" -O transformer_semeval.clf |
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
Learning Structured Representation for Text Classification | |
via Reinforcement Learning | |
https://github.com/keavil/AAAI18-code |
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
def reduce_mem_usage(df): | |
""" iterate through all the columns of a dataframe and modify the data type | |
to reduce memory usage. | |
""" | |
start_mem = df.memory_usage().sum() / 1024**2 | |
print('Memory usage of dataframe is {:.2f} MB'.format(start_mem)) | |
for col in df.columns: | |
col_type = df[col].dtype | |
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 tensorflow as tf | |
import tensorflow_hub as hub | |
module_url = "https://tfhub.dev/google/universal-sentence-encoder-large/3" | |
# Import the Universal Sentence Encoder's TF Hub module | |
embed = hub.Module(module_url) | |
# Compute a representation for each message, showing various lengths supported. | |
messages = ["That band rocks!", "That song is really cool."] | |
with tf.Session() as session: |
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 IPython import display | |
for i in range(100): | |
display.clear_output(wait=True) | |
print(i) |
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
sudo add-apt-repository ppa:graphics-drivers -y | |
sudo apt-get update | |
sudo apt-get install nvidia-driver-418 nvidia-utils-418 nvidia-settings -y | |
wget -N https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.105_418.39_linux.run | |
wget -N http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/libcudnn7_7.5.0.56-1+cuda10.1_amd64.deb | |
sudo ./cuda_10.1.105_418.39_linux.run --override --silent --toolkit --no-opengl-libs | |
sudo dpkg -i libcudnn7_7.5.0.56-1+cuda10.1_amd64.deb | |
sudo apt-get install libcupti-dev -y |
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
# Setting default encoding python ENV - Ubuntu (Linux) - /bin/bash | |
export PYTHONIOENCODING=UTF-8 | |
***************************************************************************************** | |
# Making python server on any directory | |
python3 -m http.server |
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
cd ~ && python3 -m http.server 8082 |
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
ttyd -p 5055 -i 0.0.0.0 -R tmux a -r -t 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
#CODE | |
#Generate root password | |
import random, string | |
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20)) | |
#Download ngrok | |
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
! unzip -qq -n ngrok-stable-linux-amd64.zip | |
#Setup sshd |