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
| #include <armadillo> | |
| #include <bits/stdc++.h> | |
| #include <conio.h> | |
| using namespace std; | |
| double LeastSquaesCost(const mat& X, const mat& y, const mat& parameters) | |
| { | |
| vec tmp(X * parameters - y); | |
| tmp = dot(tmp, tmp); | |
| double s = sum(tmp); |
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
| void quasinewton(const mat& X, | |
| const mat& y, | |
| mat& parameters, | |
| double computeCost(const mat& X, const mat& y, const mat& parameters), // LeastSquaesCost or logisticCost | |
| vec computeGradient(const mat& X, const mat& y, const mat& parameters), // LeastSquaesGradient or logisticGradient | |
| mat computeHessian(const mat& X, const mat& y, const mat& parameters), // logisticHessian or | |
| string method = "BFGS", // BFGS or BROYDEN or DFP or SR1 | |
| string costs_file = "costs.out", | |
| string parameters_file = "parameters.out", | |
| string step = "armijo", // double as string like "0.01" by default armijo rule |
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
| # installation | |
| !pip install knockknock #For sending message to telegram | |
| # Importation | |
| from knockknock import telegram_sender | |
| from kaggle_secrets import UserSecretsClient | |
| user_secrets = UserSecretsClient() | |
| token = user_secrets.get_secret("token") | |
| chat_id = user_secrets.get_secret("chat_id") |
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
| urls = """https://api.zindi.africa/v1/competitions/lacuna-correct-field-detection-challenge/files/sentinel-2-part1.zip | |
| https://api.zindi.africa/v1/competitions/lacuna-correct-field-detection-challenge/files/extra_train-planet-dec17.zip | |
| https://api.zindi.africa/v1/competitions/lacuna-correct-field-detection-challenge/files/extra_train-planet-jun18.zip | |
| https://api.zindi.africa/v1/competitions/lacuna-correct-field-detection-challenge/files/starter-notebook.ipynb | |
| https://api.zindi.africa/v1/competitions/lacuna-correct-field-detection-challenge/files/extra_train-sentinel.zip | |
| https://api.zindi.africa/v1/competitions/lacuna-correct-field-detection-challenge/files/sentinel_for_points_collected_in_2015.zip | |
| https://api.zindi.africa/v1/competitions/lacuna-correct-field-detection-challenge/files/extra_train-planet-jun17.zip | |
| https://api.zindi.africa/v1/competitions/lacuna-correct-field-detection-challenge/files/extra_train-planet-dec18.zip | |
| https://api.zindi.africa/v1/competitions/lacuna-correct-field-detection-challenge/f |
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 | |
| from scipy.fftpack import fft | |
| def vehicle_condition_detection(acc_info, g, h, h_prime, h_1, h_2, T): | |
| time = 0 | |
| vehicle_condition = "Unknown" | |
| while True: | |
| for t in range(len(acc_info)): | |
| Ax, Ay, Az = acc_info[t] |
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 librosa | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import tensorflow as tf | |
| def plot_spectrogram(sound, sr): | |
| S = librosa.feature.melspectrogram(sound, sr=sr) | |
| log_S = librosa.power_to_db(S, ref=np.max) | |
| plt.figure(figsize=(12, 4)) | |
| librosa.display.specshow(log_S, sr=sr, x_axis='time', y_axis='mel') |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Response> | |
| <Say voice="woman" language="es-ES"> Hola cómo estás </Say> | |
| </Response> |
OlderNewer