sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 hidden or 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
# https://stackoverflow.com/questions/10307280/how-to-define-a-shell-script-with-variable-number-of-arguments | |
run(){ | |
my_cmd=$1; | |
# cmd_str='history -d $((HISTCMD)) && $my_cmd'; | |
shift | |
#echo $my_cmd "$@" | |
history -d $((HISTCMD-1)) && $my_cmd "$@" | |
} |
This file contains hidden or 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
# directly taken from: https://unix.stackexchange.com/questions/177572/how-to-rename-terminal-tab-title-in-gnome-terminal | |
function set-title() { | |
if [[ -z "$ORIG" ]]; then | |
ORIG=$PS1 | |
fi | |
TITLE="\[\e]2;$*\a\]" | |
PS1=${ORIG}${TITLE} | |
} |
This file contains hidden or 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
.ipynb_checkpoints | |
*/.ipynb_checkpoints/* | |
*.pyc | |
.vscode | |
*/.vscode/* |
This file contains hidden or 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 os | |
import numpy as np | |
def sample_learning_rate_value(low = 0.0001, high = 1): | |
log_low = np.log10(low) | |
log_high = np.log(high) | |
r = np.random.randint(log_low, log_high)*np.random.rand() | |
alpha = 10**r | |
return alpha |
This file contains hidden or 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 save_pickle(pkl_object, name): | |
with open(name, 'wb') as handle: | |
pickle.dump(pkl_object, handle, protocol=pickle.HIGHEST_PROTOCOL) | |
def read_pickle(pickle_file): | |
b = None | |
with open(pickle_file, 'rb') as handle: | |
b = pickle.load(handle) | |
return b |
This file contains hidden or 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 get_classification_report(y_test, y_pred): | |
'''Source: https://stackoverflow.com/questions/39662398/scikit-learn-output-metrics-classification-report-into-csv-tab-delimited-format''' | |
from sklearn import metrics | |
report = metrics.classification_report(y_test, y_pred, output_dict=True) | |
df_classification_report = pd.DataFrame(report).transpose() | |
df_classification_report = df_classification_report.sort_values(by=['f1-score'], ascending=False) | |
return df_classification_report |