Skip to content

Instantly share code, notes, and snippets.

View M4TTRX's full-sized avatar
🦖

Matthieu Roux M4TTRX

🦖
View GitHub Profile
@M4TTRX
M4TTRX / genius_lyrics_getter
Created March 16, 2021 16:51
Gets lyrics for a given song and its artist using the Genius API
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
@M4TTRX
M4TTRX / back_propagation.py
Last active December 7, 2023 01:04
Custom made Back propagation neural network
"""
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
@M4TTRX
M4TTRX / perceptron.py
Last active March 16, 2021 16:51
Custom perceptron
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):
@M4TTRX
M4TTRX / rain_trap.py
Created February 29, 2020 04:28
Trapping Rain Problem
# 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

Keybase proof

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: