Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #8 from dmlc/master
Browse files Browse the repository at this point in the history
merge back
  • Loading branch information
hetong007 committed Nov 2, 2015
2 parents a1f8ce7 + 9832672 commit 35c53f6
Show file tree
Hide file tree
Showing 184 changed files with 2,540 additions and 567 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ deps
# R
*.Rcheck
*.rds
*.Rproj
.Rproj.user
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# disable sudo to use container based build
sudo: false

language: cpp
Expand All @@ -18,6 +17,7 @@ env:
- TASK=cpp_test
# run tests/python
- TASK=python_test
#- TASK=r_test

# TODO, R test, distributed test, clang, more g++ versions

Expand All @@ -27,6 +27,8 @@ matrix:
env: TASK=lint
- os: osx
env: TASK=doc
- os: linux
env: TASK=r_test

# dependent apt packages
addons:
Expand Down Expand Up @@ -67,10 +69,13 @@ cache:

before_cache:
- dmlc-core/scripts/travis/travis_before_cache.sh

after_failure:
- tests/travis/travis_after_failure.sh

notifications:
# Emails are sent to the committer's git-configured email address by default,
email:
on_success: change
on_failure: always
slack: dmlc:NmroCzntCiWOuxUZpii40USd
#slack: dmlc:NmroCzntCiWOuxUZpii40USd
22 changes: 16 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ mxnet_option(USE_OPENCV "Build with OpenCV support" ON)
mxnet_option(USE_OPENMP "Build with Openmp support" ON)
mxnet_option(USE_CUDNN "Build with cudnn support" ON) # one could set CUDNN_ROOT for search path
mxnet_option(USE_CUDA "Build with CUDA support" ON)
mxnet_option(USE_DIST_KVSTORE "Build with DIST_KVSTORE support" OFF)



include(mshadow/cmake/mshadow.cmake)
include(mshadow/cmake/Utils.cmake)
Expand Down Expand Up @@ -65,8 +68,8 @@ if(USE_CUDNN)
endif()

add_subdirectory("dmlc-core")
if(NOT MSVC)
add_subdirectory("ps-lite")
if(USE_DIST_KVSTORE)
add_subdirectory("ps-lite")
endif()

mxnet_source_group("Source" GLOB_RECURSE "src/*.cc")
Expand All @@ -91,6 +94,7 @@ if(USE_CUDA)
list(APPEND SOURCE ${cuda_objs} ${cuda})
endif()


if(NOT MSVC)
# Only add c++11 flags and definitions after cuda compiling
add_definitions(-DDMLC_USE_CXX11)
Expand All @@ -102,12 +106,18 @@ endif()
add_library(mxnet SHARED ${SOURCE})
target_link_libraries(mxnet ${mshadow_LINKER_LIBS})
target_link_libraries(mxnet dmlccore)
if(NOT MSVC)
target_link_libraries(mxnet pslite)
target_link_libraries(mxnet ${pslite_LINKER_LIBS})
endif()



set_target_properties(mxnet PROPERTIES OUTPUT_NAME "libmxnet")

if(USE_DIST_KVSTORE)
add_definitions(-DMXNET_USE_DIST_KVSTORE)
target_link_libraries(mxnet pslite)
target_link_libraries(mxnet ${pslite_LINKER_LIBS})
include_directories(SYSTEM ${pslite_INCLUDE_DIR})
endif()

# ---[ Linter target
if(MSVC)
find_package(PythonInterp 2)
Expand Down
17 changes: 13 additions & 4 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ The committers are the granted write access to the project.
- Mingjie is the initiator, and contributes the design of the dependency engine.
* [Chuntao Hong](https://github.com/hjk41)
- Chuntao is the initiator and provides the initial design of engine.
* [Chiyuan Zhang](https://github.com/pluskid)
- Chiyuan is the creator of MXNet Julia Package.
* [Qiang Kou](https://github.com/thirdwing)
- KK is a R ninja, he makes mxnet available for R users.
* [Tong He](https://github.com/hetong007)
- Tong is the major maintainer of MXNetR, he designs the mxnet interface and wrote many of the tutorials on R.

### Become a Comitter
MXNet is a opensource project and we are actively looking for new comitters
Expand All @@ -39,12 +45,10 @@ List of Contributors
--------------------
* [Full List of Contributors](https://github.com/dmlc/mxnet/graphs/contributors)
- To contributors: please add your name to the list when you submit a patch to the project:)
* [Qiang Kou](https://github.com/thirdwing)
- KK is a R ninja, he makes mxnet available for R users.
* [Tong He](https://github.com/hetong007)
- Tong is the major maintainer of MXNetR, he designs the mxnet interface and wrote many of the tutorials on R.
* [Feng Wang](https://github.com/happynear)
- Feng makes mxnet compatible with Windows Visual Studio.
* [Jack Deng](https://github.com/jdeng)
- Jack created the amalgamation script and Go bind for mxnet.
* [Li Dong](https://github.com/donglixp)
* [Piji Li](https://github.com/lipiji)
* [Hu Shiwen](https://github.com/yajiedesign)
Expand All @@ -55,3 +59,8 @@ List of Contributors
* [Xiaodong](https://github.com/XD-DENG)
* [Nan Xiao](https://github.com/road2stat)
* [Junyuan Xie](https://github.com/piiswrong)
* [Wei Wu](https://github.com/tornadomeet)
* [Yuan Tang](https://github.com/terrytangyuan)
- Yuan set up the R Travis environment to make development safer.
* [Michaël Benesty](https://github.com/pommedeterresautee)
-Michaël contributes the R visualization module of mxnet
17 changes: 14 additions & 3 deletions R-package/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ Version: 0.5
Date: 2015-10-02
Author: Tianqi Chen, Qiang Kou, Tong He
Maintainer: Qiang Kou <[email protected]>
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.
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: BSD
URL: https://github.com/dmlc/mxnet/R-package
BugReports: https://github.com/dmlc/mxnet/issues
Imports: methods, Rcpp (>= 0.11.1)
Suggests: testthat
Imports:
methods,
Rcpp (>= 0.11.1),
DiagrammeR,
data.table,
jsonlite,
magrittr,
stringr
Suggests:
testthat
LinkingTo: Rcpp
RoxygenNote: 5.0.0
25 changes: 23 additions & 2 deletions R-package/NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by roxygen2 (4.1.1): do not edit by hand
# Generated by roxygen2: do not edit by hand

S3method(Ops,MXNDArray)
S3method(as.array,MXNDArray)
Expand All @@ -9,6 +9,7 @@ S3method(predict,MXFeedForwardModel)
S3method(print,MXNDArray)
export(arguments)
export(ctx)
export(graph.viz)
export(is.mx.context)
export(is.mx.dataiter)
export(is.mx.ndarray)
Expand Down Expand Up @@ -40,11 +41,14 @@ export(mx.model.FeedForward.create)
export(mx.model.load)
export(mx.model.save)
export(mx.nd.array)
export(mx.nd.choose.element)
export(mx.nd.choose.element.0index)
export(mx.nd.clip)
export(mx.nd.copyto)
export(mx.nd.dot)
export(mx.nd.exp)
export(mx.nd.load)
export(mx.nd.log)
export(mx.nd.norm)
export(mx.nd.ones)
export(mx.nd.save)
export(mx.nd.sqrt)
Expand All @@ -58,6 +62,7 @@ export(mx.set.seed)
export(mx.simple.bind)
export(mx.symbol.Activation)
export(mx.symbol.BatchNorm)
export(mx.symbol.BlockGrad)
export(mx.symbol.Concat)
export(mx.symbol.Convolution)
export(mx.symbol.Dropout)
Expand All @@ -74,10 +79,26 @@ export(mx.symbol.Reshape)
export(mx.symbol.SliceChannel)
export(mx.symbol.Softmax)
export(mx.symbol.Variable)
export(mx.symbol.exp)
export(mx.symbol.infer.shape)
export(mx.symbol.load)
export(mx.symbol.log)
export(mx.symbol.save)
export(mx.symbol.sqrt)
export(mx.symbol.square)
export(mxnet.export)
export(outputs)
import(Rcpp)
import(methods)
importFrom(DiagrammeR,combine_edges)
importFrom(DiagrammeR,create_edges)
importFrom(DiagrammeR,create_graph)
importFrom(DiagrammeR,create_nodes)
importFrom(DiagrammeR,render_graph)
importFrom(data.table,":=")
importFrom(data.table,as.data.table)
importFrom(data.table,data.table)
importFrom(data.table,setkey)
importFrom(jsonlite,fromJSON)
importFrom(magrittr,"%>%")
importFrom(stringr,str_extract_all)
109 changes: 103 additions & 6 deletions R-package/R/mxnet_generated.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Generated by mxnet.export, do not edit by hand.
######

#' Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs
#' Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
#'
#' @param lhs NDArray
#' Left operand to the function.
Expand All @@ -11,7 +11,7 @@
#' @return out The result mx.ndarray
#'
#' @export
#' @name mx.nd.choose.element
#' @name mx.nd.choose.element.0index
NULL

#' Clip ndarray elements to range (a_min, a_max)
Expand Down Expand Up @@ -40,10 +40,40 @@ NULL
#' @name mx.nd.dot
NULL

#' Take square root of the src
#' Take exp of the src
#'
#' @param src NDArray
#' Source input to the function.
#' Source input to the function
#' @return out The result mx.ndarray
#'
#' @export
#' @name mx.nd.exp
NULL

#' Take log of the src
#'
#' @param src NDArray
#' Source input to the function
#' @return out The result mx.ndarray
#'
#' @export
#' @name mx.nd.log
NULL

#' Take L2 norm of the src.The result will be ndarray of shape (1,) on the same device.
#'
#' @param src NDArray
#' Source input to the function
#' @return out The result mx.ndarray
#'
#' @export
#' @name mx.nd.norm
NULL

#' Take sqrt of the src
#'
#' @param src NDArray
#' Source input to the function
#' @return out The result mx.ndarray
#'
#' @export
Expand All @@ -53,7 +83,7 @@ NULL
#' Take square of the src
#'
#' @param src NDArray
#' Source input to the function.
#' Source input to the function
#' @return out The result mx.ndarray
#'
#' @export
Expand Down Expand Up @@ -208,6 +238,19 @@ mx.symbol.BatchNorm <- function(...) {
mx.varg.symbol.BatchNorm(list(...))
}

#' Get output from a symbol and pass 0 gradient back
#'
#' @param data Symbol
#' Input data.
#' @param name string, optional
#' Name of the resulting symbol.
#' @return out The result mx.symbol
#'
#' @export
mx.symbol.BlockGrad <- function(...) {
mx.varg.symbol.BlockGrad(list(...))
}

#' Perform an feature concat on channel dim (dim 1) over all the inputs.
#'
#' @param num.args int, required
Expand Down Expand Up @@ -238,7 +281,7 @@ mx.symbol.Concat <- function(...) {
#' @param num.filter int (non-negative), required
#' convolution filter(channel) number
#' @param num.group int (non-negative), optional, default=1
#' number of groups partition
#' Number of groups partition. This option is not supported by CuDNN, you can use SliceChannel to num_group,apply convolution and concat instead to achieve the same need.
#' @param workspace long (non-negative), optional, default=512
#' Tmp workspace for convolution (MB)
#' @param no.bias boolean, optional, default=False
Expand Down Expand Up @@ -442,6 +485,8 @@ mx.symbol.SliceChannel <- function(...) {
#' Input data to softmax.
#' @param grad.scale float, optional, default=1
#' Scale the gradient by a float factor
#' @param multi.output boolean, optional, default=False
#' If set to true, for a (n,k,x_1,..,x_n) dimensionalinput tensor, softmax will generate n*x_1*...*x_n output, eachhas k classes
#' @param name string, optional
#' Name of the resulting symbol.
#' @return out The result mx.symbol
Expand All @@ -450,3 +495,55 @@ mx.symbol.SliceChannel <- function(...) {
mx.symbol.Softmax <- function(...) {
mx.varg.symbol.Softmax(list(...))
}

#' Take exp of the src
#'
#' @param src Symbol
#' Source symbolic input to the function
#' @param name string, optional
#' Name of the resulting symbol.
#' @return out The result mx.symbol
#'
#' @export
mx.symbol.exp <- function(...) {
mx.varg.symbol.exp(list(...))
}

#' Take log of the src
#'
#' @param src Symbol
#' Source symbolic input to the function
#' @param name string, optional
#' Name of the resulting symbol.
#' @return out The result mx.symbol
#'
#' @export
mx.symbol.log <- function(...) {
mx.varg.symbol.log(list(...))
}

#' Take sqrt of the src
#'
#' @param src Symbol
#' Source symbolic input to the function
#' @param name string, optional
#' Name of the resulting symbol.
#' @return out The result mx.symbol
#'
#' @export
mx.symbol.sqrt <- function(...) {
mx.varg.symbol.sqrt(list(...))
}

#' Take square of the src
#'
#' @param src Symbol
#' Source symbolic input to the function
#' @param name string, optional
#' Name of the resulting symbol.
#' @return out The result mx.symbol
#'
#' @export
mx.symbol.square <- function(...) {
mx.varg.symbol.square(list(...))
}
Loading

0 comments on commit 35c53f6

Please sign in to comment.