This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-organize based on KK's code
- Loading branch information
Showing
20 changed files
with
351 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\.o$ | ||
\.so$ | ||
\.dll$ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
|
||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.Rhistory | ||
R-package.Rproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
Package: mxnet | ||
Type: Package | ||
Title: MXNet | ||
Version: 1.0 | ||
Version: 0.5 | ||
Date: 2015-10-02 | ||
Author: Your Name | ||
Maintainer: Your Name <your@email.com> | ||
Author: Qiang Kou | ||
Maintainer: Your <your@email.com> | ||
Description: MXNet is a deep learning framework designed for both efficiency and flexibility. It allows you to mix the flavours of deep learning programs together to maximize the efficiency and your productivity. | ||
License: Apache-2.0 | ||
Imports: Rcpp (>= 0.12.1) | ||
URL: /~https://github.com/dmlc/mxnet | ||
BugReports: /~https://github.com/dmlc/mxnet/issues | ||
Imports: Rcpp (>= 0.11.1) | ||
LinkingTo: Rcpp |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loadModule("mxnet", TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
MXNet R-Package | ||
=============== | ||
This is an on-going effort to support mxnet in R, stay tuned. | ||
|
||
Bleeding edge Installation | ||
- First build ```../lib/libmxnet.so``` by following [Build Instruction](doc/build.md) | ||
- Set the path to ```lib/libmxnet.so``` in ```LD_LIBRARY_PATH```, you can do it by modify ```~/.bashrc``` | ||
```bash | ||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/lib/libmxnet.so | ||
``` | ||
- Type ```R CMD INSTALL R-package``` in the root folder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
basic_ndarray Basic ndarray operations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
library(mxnet) |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# _*_ mode: makefile; _*_ | ||
PKGROOT=../../ | ||
|
||
# This file is only used for compilation from github | ||
# It will be replaced by more formal Rpackage structure | ||
# Where PKGROOT moved to root directory | ||
|
||
.PHONY: all mxlib | ||
all: $(SHLIB) | ||
|
||
$(SHLIB): mxlib | ||
mxlib: | ||
cd $(PKGROOT); make CXX="$(CXX)"; cd - | ||
cp $(PKGROOT)/lib/libmxnet.so libmxnet.so | ||
mkdir -p ../inst | ||
mkdir -p ../inst/libs | ||
cp $(PKGROOT)/lib/libmxnet.so ../inst/libs/libmxnet.so | ||
|
||
# Need to add libmxnet.so to LD_LIBRARY_PATH | ||
# TODO: make it install together with mxnet.so | ||
LINKMXNET = -L../inst/libs -lmxnet | ||
|
||
PKG_CPPFLAGS = -I$(PKGROOT)/include -I$(PKGROOT)/dmlc-core/include | ||
PKG_LIBS = $(LINKMXNET) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*! | ||
* Copyright (c) 2015 by Contributors | ||
* \file base.h | ||
* \brief Rcpp interface of MXNet | ||
*/ | ||
#ifndef MXNET_RCPP_BASE_H_ | ||
#define MXNET_RCPP_BASE_H_ | ||
|
||
#include <Rcpp.h> | ||
#include <mxnet/c_api.h> | ||
// to be removed | ||
#include <dmlc/logging.h> | ||
|
||
namespace mxnet { | ||
namespace R { | ||
|
||
// change to Rcpp::cerr later, for compatiblity of older version for now | ||
#define RLOG_FATAL LOG(FATAL) | ||
|
||
/*! | ||
* \brief protected MXNet C API call, report R error if happens. | ||
* \param func Expression to call. | ||
*/ | ||
#define MX_CALL(func) \ | ||
{ \ | ||
int e = (func); \ | ||
if (e != 0) { \ | ||
RLOG_FATAL << MXGetLastError(); \ | ||
} \ | ||
} | ||
} // namespace Rcpp | ||
} // namespace mxnet | ||
#endif // MXNET_RCPP_BASE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <Rcpp.h> | ||
#include "./ndarray.h" | ||
|
||
RCPP_MODULE(mxnet) { | ||
using namespace mxnet::R; // NOLINT(*) | ||
NDArray::InitRcppModule(); | ||
NDArrayFunction::InitRcppModule(); | ||
} |
Oops, something went wrong.