I hereby claim:
- I am m4ttrx on github.
- I am matthieuroux (https://keybase.io/matthieuroux) on keybase.
- I have a public key ASAXb8GvaZGtlReiRopzUOfsuHfnsm9zfLak8znqEorGUQo
To claim this, I am signing this object:
from lyricsgenius import Genius | |
import pandas as pd | |
import numpy as np | |
from progress.bar import Bar | |
def check_song(song): | |
# empty songs should be ignored | |
if song is None: | |
return False |
""" | |
Author: Matthieu Roux | |
Date of creation: February 2019 | |
Python Version: 3.6.8 on Windows 10 64 bit | |
Description: Creates a 3 layer neural network (one input, one hidden and one output), | |
that can be trained using backpropagation. | |
The program can also evaluate its accuracy, precision and import/save trained weights. | |
All files must come from .csv (MS-DOS) files and must have been pre-processed and normalized |
import csv | |
# This class helps organising perceptrons, it holds weights and its training data | |
class perceptron: | |
def __init__(self, weights, training_data): | |
self.weights = weights | |
self.data = training_data | |
# saves the weights in a csv file after training | |
def save_weights(self,filename): |
# Attempts to solve the following problem https://leetcode.com/problems/trapping-rain-water/ | |
def trap(self, height): | |
water_volume = 0 | |
while sum(height) > 0: | |
left_index = None | |
for right_index in range(len(height)): | |
if height[right_index] > 0: | |
if left_index != None: | |
water_volume += right_index - left_index - 1 | |
height[right_index] -= 1 |
I hereby claim:
To claim this, I am signing this object: