Skip to content

Instantly share code, notes, and snippets.

View huseinzol05's full-sized avatar
🍵
Hunting cendol!

HUSEIN ZOLKEPLI huseinzol05

🍵
Hunting cendol!
View GitHub Profile
@huseinzol05
huseinzol05 / time-comparison-numpy-cupy.ipynb
Last active February 23, 2018 11:30
time comparison Numpy and Cupy for feed-forward neural network on Iris dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@huseinzol05
huseinzol05 / loop-cnn.ipynb
Created February 24, 2018 12:30
loop 2d convolution process
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@huseinzol05
huseinzol05 / conv2d-mnist.ipynb
Created March 4, 2018 09:56
convolutional neural network pure numpy including back-propagation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@huseinzol05
huseinzol05 / atrous2d-loop-backpropagation.ipynb
Created March 5, 2018 08:32
atrous2d loop based with back-propagation using numpy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@huseinzol05
huseinzol05 / maxpooling2d.ipynb
Created March 6, 2018 14:54
max pooling 2d numpy with back-propagation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@huseinzol05
huseinzol05 / avgpooling2d.ipynb
Last active March 6, 2018 15:03
average pooling 2d numpy with back-propagation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@huseinzol05
huseinzol05 / query-mysql.py
Created March 19, 2018 06:10
query to mysql
query = r'"najib" OR "mahathir"'
def query_to_mysql(query, column_name):
query = query.replace(r'"', "'")
splitted = query.split("'")
for i in range(len(splitted)):
if splitted[i].find('AND') < 0 and splitted[i].find('OR') < 0 and len(splitted[i])>2:
splitted[i] = column_name + ' like \'%'+splitted[i]+'%\''
return ' '+''.join(splitted)
@huseinzol05
huseinzol05 / parse-date-google.py
Created April 3, 2018 03:59
parse any string from google search
string = '2015年5月17日'
import re
re.findall("[-+]?[.]?[\d]+(?:,\d\d\d)*[\.]?\d*(?:[eE][-+]?\d+)?", string)
# ['2015', '5', '17']
@huseinzol05
huseinzol05 / spatialdropout.py
Created May 19, 2018 00:52
spatial dropout in tensorflow
import tensorflow as tf
x = tf.random_normal((32, 4, 10))
out = tf.layers.dropout(x, 0.5, noise_shape=[x.shape[0], x.shape[1], tf.constant(1)]))
@huseinzol05
huseinzol05 / residualblock.py
Last active May 19, 2018 02:27
Residual block on tensorflow
import tensorflow as tf
x = tf.random_normal((32, 4, 10))
x_copy = x
size = 16
kernel = 4
rate = 2
pad_len = (kernel - 1) * rate
x = tf.pad(x, [[0, 0], [pad_len, 0], [0, 0]])
x = tf.layers.conv1d(x, size, 4, dilation_rate=rate)