Skip to content

Instantly share code, notes, and snippets.

@Piyush3dB
Piyush3dB / nnvmOpReg
Created June 1, 2017 13:04
Operator Registration in NNVM
struct pair intPair;
int firstInt;
int secndInt;
const struct string attrStr;
struct allocator attrStrAlloc;
const struct string descStr;
struct allocator descStrAlloc;
const struct string opName;
struct allocator opNameAlloc;
struct Registry * registryHandle;
@Piyush3dB
Piyush3dB / config.mk
Created March 7, 2017 08:16
MXNet config.mk @w
#-------------------------------------------------------------------------------
# Template configuration for compiling mxnet
#
# If you want to change the configuration, please use the following
# steps. Assume you are on the root directory of mxnet. First copy the this
# file so that any local changes will be ignored by git
#
# $ cp make/config.mk .
#
# Next modify the according entries, and then compile by
@Piyush3dB
Piyush3dB / mxnet-operators.txt
Created February 27, 2017 09:35
MXNet operators
'Activation'
'BatchNorm'
'BilinearSampler'
'BlockGrad'
'Cast'
'Concat'
'Convolution'
'Correlation'
'Crop'
'Custom'
import numpy as np
import pdb as pdb
# Angle per point
angle = np.pi/6
# Total number of points to evaluate
N = 2*np.pi/angle
>>> g++ -c -std=c++11 ./src/deprecated-attribute.cpp
./src/deprecated-attribute.cpp:3:10: warning: ‘deprecated’ attribute directive ignored [-Wattributes]
void foo() {}
^
>>> echo $?
0
>>> g++ -c ./src/deprecated-attribute.cpp
./src/deprecated-attribute.cpp:2:1: error: expected unqualified-id before ‘[’ token
[[deprecated("will be removed in future")]]
^
@Piyush3dB
Piyush3dB / pub_sub_cpp.cpp
Created October 26, 2016 13:19 — forked from makomweb/pub_sub_cpp.cpp
Fun with C++: implementing a pub/sub scenario using std::bind and other standard facilities. The approach is pretty similar to the well known .NET event mechanism.
#include <iostream>
#include <map>
#include <algorithm>
#include <functional>
#include <memory>
using namespace std;
class EventArgs {
public:
@Piyush3dB
Piyush3dB / jekyll-install.txt
Last active June 21, 2017 22:12
Jekyll 3.2.1, Ruby 2.2.3 install on Ubuntu 14.04
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
rbenv install -v 2.2.3
rbenv global 2.2.3
ruby -v
@Piyush3dB
Piyush3dB / install-opencv.sh
Created September 2, 2016 22:23
OpenCV installation Ubuntu 14.04
# KEEP UBUNTU OR DEBIAN UP TO DATE
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
# INSTALL THE DEPENDENCIES
a - build/src/operator/activation.o
a - build/src/operator/batch_norm.o
a - build/src/operator/block_grad.o
a - build/src/operator/broadcast_reduce_op.o
a - build/src/operator/cast.o
a - build/src/operator/concat.o
a - build/src/operator/convolution.o
a - build/src/operator/correlation.o
a - build/src/operator/crop.o
a - build/src/operator/cross_device_copy.o
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Model
from keras.layers import Convolution2D, Activation, Input
#%matplotlib inline
#plt.rcParams['image.cmap'] = 'gray'