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 keras | |
from keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPooling2D, GlobalAveragePooling2D, BatchNormalization | |
from keras.models import Sequential | |
from keras.optimizers import Adam | |
from keras import regularizers | |
def model_cnn_reg(input_shape): | |
model=Sequential() | |
model.add(Conv2D(filters=64,kernel_size=(3,3), input_shape=input_shape, activation='relu')) | |
model.add(MaxPooling2D(pool_size=(2,2))) |
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 numpy as np | |
import tensorflow.keras as keras | |
def build_model(input_shape): | |
"""Generates RNN-LSTM model | |
:param input_shape (tuple): Shape of input set | |
:return model: RNN-LSTM model | |
""" |
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 numpy as np | |
import tensorflow.keras as keras | |
def build_model(input_shape): | |
"""Generates RNN-LSTM model | |
:param input_shape (tuple): Shape of input set | |
:return model: RNN-LSTM model | |
""" | |
# build network topology |
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 numpy as np | |
import tensorflow.keras as keras | |
def build_model(input_shape): | |
"""Generates CNN model | |
:param input_shape (tuple): Shape of input set | |
:return model: CNN model | |
""" | |
# build network topology |
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 extract_feature_means(audio_file_path: str) -> pd.DataFrame: | |
# config settings | |
number_of_mfcc = c.NUMBER_OF_MFCC | |
# 1. Importing 1 file | |
y, sr = librosa.load(audio_file_path) | |
# Trim leading and trailing silence from an audio signal (silence before and after the actual audio) | |
signal, _ = librosa.effects.trim(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
import matplotlib | |
matplotlib.use('Qt5Agg') | |
import numpy as np | |
import pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
from sklearn.feature_selection import f_classif, mutual_info_classif | |
from sklearn.preprocessing import MinMaxScaler | |
from itertools import cycle | |
from numpy import interp |
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 imblearn.ensemble import BalancedRandomForestClassifier | |
from sklearn.datasets import make_classification | |
from imblearn.pipeline import Pipeline | |
from sklearn.model_selection import train_test_split | |
from sklearn import metrics | |
X, y = make_classification(n_samples=1000, n_classes=3, | |
n_informative=4, weights=[0.2, 0.3, 0.5], | |
random_state=0) |
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 matplotlib | |
matplotlib.use('TkAgg') | |
import mne | |
import h5py | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import numpy.typing as npt | |
plt.ion() | |
def zero_detector(arr: npt.NDArray[np.uint]) -> list([npt.NDArray[np.uint], |
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/sh | |
# PostgreSQL database backup script | |
DB_USERNAME='' | |
DB_NAME='' | |
DB_PASSWORD='' | |
DB_HOST='' | |
TIMESTAMP=`date +%Y%m%d-%H%M` | |
BACKUP_DIR='/Vast/pg_backup' |
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 numpy as np | |
import matplotlib.pyplot as plt | |
def rectified(x): | |
return max(0.0, x) | |
X = np.arange(-100, 100) | |
y = np.array([rectified(x) for x in X]) | |
for index in range(1, 10): | |
yy = y ** index |
NewerOlder