๐
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 numpy as np | |
| import pandas as pd | |
| import tensorflow as tf | |
| tf.enable_eager_execution() | |
| training_df: pd.DataFrame = pd.DataFrame( | |
| data={ | |
| 'feature1': np.random.rand(10), | |
| 'feature2': np.random.rand(10), |
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 numpy as np | |
| import pandas as pd | |
| from scipy.interpolate import CubicSpline | |
| def interpolate_time_series(time_series: pd.Series, n_points: int) -> pd.Series: | |
| """ | |
| Interpolate the pattern in the standardized time series data into `n_points` | |
| number of values at equal intervals between 0 and 1. |
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
| from __future__ import print_function | |
| import keras | |
| from keras.datasets import mnist | |
| from keras.models import Sequential | |
| from keras.layers import Dense, Dropout, Flatten | |
| from keras.layers import Conv2D, MaxPooling2D | |
| from keras import backend as K | |
| from keras.callbacks import TensorBoard | |
| batch_size = 128 |
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
| # You can change the directory name | |
| LOG_DIR = 'tb_logs' | |
| !wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
| !unzip ngrok-stable-linux-amd64.zip | |
| import os | |
| if not os.path.exists(LOG_DIR): | |
| os.makedirs(LOG_DIR) | |
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
| # Which file to send? | |
| file_name = "REPO.tar" | |
| from googleapiclient.http import MediaFileUpload | |
| from googleapiclient.discovery import build | |
| auth.authenticate_user() | |
| drive_service = build('drive', 'v3') | |
| def save_file_to_drive(name, path): |
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
| name: release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| release: | |
| name: Build | |
| runs-on: ubuntu-latest |
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
| #!/usr/bin/env python3 | |
| import os | |
| import sys | |
| from glob import glob | |
| import librosa | |
| import time | |
| import numpy | |
| numpy.random.seed(42) |
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
| # The script illustartes stunning difference on my machine with processing of signal with multiprocessing and joblib. | |
| # The slowness of multiprocessing is likely caused by oversubscription | |
| import time | |
| import numpy as np | |
| import librosa | |
| from joblib import Parallel, delayed | |
| from functools import partial | |
| from multiprocessing import Pool |
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
| from sklearn.utils import check_arrays | |
| def mean_absolute_percentage_error(y_true, y_pred): | |
| """ | |
| Use of this metric is not recommended; for illustration only. | |
| See other regression metrics on sklearn docs: | |
| http://scikit-learn.org/stable/modules/classes.html#regression-metrics | |
| Use like any other metric | |
| >>> y_true = [3, -0.5, 2, 7]; y_pred = [2.5, -0.3, 2, 8] |