Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View praisethemoon's full-sized avatar
🌕

moon praisethemoon

🌕
View GitHub Profile
@praisethemoon
praisethemoon / BinaryConvert.c
Last active May 2, 2017 16:37
Convert Integer to binary
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#define bin(name, t) void name(t n, uint8_t* dest) { \
size_t size = sizeof(t) * 8;\
t counter = 0;\
while(n){\
if(n & 1) \
dest[counter] = '1';\
@praisethemoon
praisethemoon / main.c
Created February 4, 2018 16:07
SSE vs Native Loop over FLOAT
#include <xmmintrin.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void __attribute__ ((noinline)) SSE(){
int len = 1024;
float data1 [1024] = {1, 2, 3, 4, 5, 6, 7, 8};
float data2 [1024] = {1, 2, 3, 4, 5, 6, 7, 8};
float dest[1024];
@praisethemoon
praisethemoon / Search.py
Created September 11, 2018 17:07
ThirstyShoddyLanservers-2 created by praisethemoon - https://repl.it/@praisethemoon/ThirstyShoddyLanservers-2
"""
Prints the nodes queue,
please note that the queue is actually a stack, sorted reversely.
Elements are extracted using `pop()` for ease of implementation which
is relatively the same as using a real queue and removing this first element,
Except that the first approach takes only one instruction.
"""
def printQueue(queue):
counter = len(queue)
@praisethemoon
praisethemoon / conv-v2.ipynb
Created March 26, 2019 22:09
Intuition behind convolutions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / ndarry_1.ipynb
Created March 28, 2019 19:39
2D Index to 1D Index and backwards.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / 3d-images.ipynb
Created March 28, 2019 20:36
Split RGB Image channels
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / ndarray.ipynb
Created March 29, 2019 10:50
NDArray, for tensors
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / conv-comparison.ipynb
Created March 31, 2019 00:53
conv_loop_vs_vectorized
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / conv-v2-vectorized.ipynb
Last active April 1, 2019 07:37
Convolution with im2col
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / conv-v2-vectorized-d-filters.ipynb
Created April 1, 2019 08:18
Convolution over N filters for 2D images
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.