Skip to content

Instantly share code, notes, and snippets.

View MohamedNedal's full-sized avatar

Mohamed Nedal | محمد نضال MohamedNedal

View GitHub Profile
@Nemitek
Nemitek / keras_prediction.py
Created October 22, 2015 04:11
Predicting sequences of vectors (regression) in Keras using RNN - LSTM (original by danielhnyk.cz) - fixed for Keras 0.2.0
import pandas as pd
from random import random
flow = (list(range(1,10,1)) + list(range(10,1,-1)))*1000
pdata = pd.DataFrame({"a":flow, "b":flow})
pdata.b = pdata.b.shift(9)
data = pdata.iloc[10:] * random() # some noise
import numpy as np
@ackdav
ackdav / NN-for-loop.py
Last active November 23, 2022 09:16
For loop for creating neural net layers in tensorflow
'''
I've found this little setup (https://pythonprogramming.net/community/262/TensorFlow%20For%20loop%20to%20set%20weights%20and%20biases/)
to create layers in a NN with a for loop. Unfortunately it doesn't really work - so here is a corrected version:
keep in mind, layer_config takes the form: [n_input, 200, 200, 200, 200, n_classes]
'''
def multilayer_perceptron(x, layer_config, name="neuralnet"):
'''
code from: https://pythonprogramming.net/community/262/TensorFlow%20For%20loop%20to%20set%20weights%20and%20biases/
'''
<!DOCTYPE html>
<html>
<head><title>SOUND</title></head>
<body>
<div>Frequence: <span id="frequency"></span></div>
<script type="text/javascript">
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var oscillatorNode = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();
@joergdietrich
joergdietrich / sav_to_df.py
Created March 8, 2018 14:00
Turn IDL sav file into pandas DataFrame
from scipy.io import readsav
import pandas as pd
tab = readsav('filename.sav')
d = dict()
for key in tab['table_name'].dtype.names:
v = tab['candidates'][key]
try:
v = v.byteswap().newbyteorder()
@emadehsan
emadehsan / Screen Unix Cheat Sheet.md
Created April 18, 2018 11:52
Screen Linux/Unix command cheat sheet

Install Screen

$ sudo apt install screen

Enter a new Screen Session

$ screen

Detach from current screen session

@jhjensen2
jhjensen2 / noninteracting_particle_md.ipynb
Created October 30, 2018 20:42
noninteracting_particle_MD.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Fitting Polynomial Regression to the dataset
from sklearn.preprocessing import PolynomialFeatures
poly_reg = PolynomialFeatures(degree=4)
X_poly = poly_reg.fit_transform(X)
pol_reg = LinearRegression()
pol_reg.fit(X_poly, y)
# Visualizing the Polymonial Regression results
def viz_polymonial():
plt.scatter(X, y, color='red')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcheong0428
jcheong0428 / synchrony_tutorial.ipynb
Last active October 18, 2024 16:32
Synchrony tutorial notebook
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.