Skip to content

Instantly share code, notes, and snippets.

View piiswrong's full-sized avatar

Eric Junyuan Xie piiswrong

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
#if defined(__MACH__)
#include <mach/clock.h>
#include <mach/mach.h>
#endif
#if !defined(__WIN32__)
#include <sys/stat.h>
#include <sys/types.h>
@piiswrong
piiswrong / install.sh
Last active December 12, 2017 07:58
install mxnet on ubuntu
#!/usr/bin/env bash
set -e
# install cuda-7.5
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install -y linux-image-extra-`uname -r` linux-headers-`uname -r` linux-image-`uname -r`
sudo apt-get install -y cuda-7-5
echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:\$LD_LIBRARY_PATH" | tee -a ~/.profile | tee -a ~/.bashrc
def fit(args, network, data_loader, batch_end_callback=None):
# kvstore
kv = mx.kvstore.create(args.kv_store)
model_prefix = args.model_prefix
if model_prefix is not None:
model_prefix += "-%d" % (kv.rank)
save_model_prefix = args.save_model_prefix
if save_model_prefix is None:
/*!
* Copyright (c) 2015 by Contributors
* \file leaky_relu-inl.h
* \brief leaky relu family operator
* \author Bing Xu
*/
#ifndef MXNET_OPERATOR_PROD_SUM_INL_H_
#define MXNET_OPERATOR_PROD_SUM_INL_H_
#include <dmlc/logging.h>
@piiswrong
piiswrong / test_operator.py
Last active October 24, 2015 22:52
Engine Crashes if asnumpy() is not called on result
import os
import mxnet as mx
from common import models
import pickle as pkl
def test_softmax_with_shape(shape, xpu):
X = mx.symbol.Variable('X')
L = mx.symbol.Variable('L')
Y = mx.symbol.Softmax(data=X, label=L)
x = mx.random.uniform(-1, 1, shape, ctx = xpu)