You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/29 07:02:33 UTC

[GitHub] yzhliu commented on a change in pull request #11205: Clojure Contrib Package

yzhliu commented on a change in pull request #11205: Clojure Contrib Package
URL: https://github.com/apache/incubator-mxnet/pull/11205#discussion_r199065781
 
 

 ##########
 File path: contrib/clojure-package/README.md
 ##########
 @@ -0,0 +1,230 @@
+# Clojure MXNet
+
+A clojure package to the MXNet Deep Learning library
+
+## Introduction
+
+MXNet is a first class, modern deep learning library. It supports multiple languages on a first class basis and is incubating as an Apache project.
+
+The motivation for creating a Clojure package is to be able to open the deep learning library to the Clojure ecosystem and build bridges for future development and innovation for the community. It provides all the needed tools including low level and high level apis, dynamic graphs, and things like GAN and natural language support.
+
+For high leverage, the Clojure package has been built on the existing Scala package using interop. This has allowed rapid development and close parity with the Scala functionality. This also leaves the door open to directly developing code against the jni-bindings with Clojure in the future in an incremental fashion, using the test suites as a refactoring guide.
+
+## Current State and Plans
+
+The Clojure package is nearing the end of its first development milestone which is to achieve a close parity with the Scala package.
+
+Help is needed testing and generally making the package better. A list of the pacakge status and contribution needs can be found here [Clojure Package Contribution Needs](https://cwiki.apache.org/confluence/display/MXNET/Clojure+Package+Contribution+Needs). Please get involved :)
+
+Testing instructions can be found in the testing.md.
+
+## Getting Started
+
+The following systems are supported:
+
+- OSX cpu
+- Linux cpu
+- Linux gpu
+
+There are two ways of getting going. The first way is the easiest and that is to use the pre-built jars from Maven. The second way is to build from source. In both cases, you will need to load the prereqs and dependencies, (like opencv).
+
+
+
+### Prerequisites
+
+
+Follow the instructions from https://mxnet.incubator.apache.org/install/osx_setup.html or https://mxnet.incubator.apache.org/install/ubuntu_setup.html
+about _Prepare Environment for GPU Installation_
+and _Install MXNet dependencies_
+
+
+#### Cloning the repo and running from source
+
+To use the prebuilt jars (easiest), you will need to replace the native version of the line in the project dependencies with your configuration.
+
+`[org.apache.mxnet/mxnet-full_2.11-linux-x86_64-gpu "1.2.1"]`
+or
+`[org.apache.mxnet/mxnet-full_2.11-linux-x86_64-cpu "1.2.1"]`
+or
+`[org.apache.mxnet/mxnet-full_2.11-osx-x86_64-cpu "1.2.1"]`
+
+If you are using the prebuilt jars they may have a slightly different dependencies then building from source:
+
+*For OSX you will need:*
+
+`brew install opencv`
+
+*For Ubuntu Linux you will need:*
+
+```
+sudo add-apt-repository ppa:timsc/opencv-3.4
+sudo apt-get update
+sudo apt install libopencv-imgcodecs3.4
+```
+
+*For Arch Linux you will need:*
+
+_CPU_
+
+```
+yaourt -S openblas-lapack
+yaourt -S libcurl-compat
+export LD_PRELOAD=libcurl.so.3
+```
+_GPU_
+
+```
+wget https://archive.archlinux.org/packages/c/cuda/cuda-9.0.176-4-x86_64.pkg.tar.xz
+sudo pacman -U cuda-9.0.176-4-x86_64.pkg.tar.xz
+```
+
+If you want to see the exact versions and flags that the jars were built with, look here:
+[Scala Release Process](https://cwiki.apache.org/confluence/display/MXNET/MXNet-Scala+Release+Process)
+
+
+Check your installation with `lein test`. If that works alright then, you can try some code!
+
+```clojure
+
+(ns tutorial.ndarray
+  (:require [org.apache.clojure-mxnet.ndarray :as ndarray]
+            [org.apache.clojure-mxnet.context :as context]))
+
+;;Create NDArray
+(def a (ndarray/zeros [100 50])) ;;all zero arrray of dimension 100 x 50
+(def b (ndarray/ones [256 32 128 1])) ;; all one array of dimension
+(def c (ndarray/array [1 2 3 4 5 6] [2 3])) ;; array with contents of a shape 2 x 3
+
+;;; There are also ways to convert to a vec or get the shape as an object or vec
+(ndarray/->vec c) ;=> [1.0 2.0 3.0 4.0 5.0 6.0]
+```
+
+See the examples/tutorial section for more.
+
+
+The jars from maven with the needed MXNet native binaries in it. On startup, the native libraries are extracted from the jar and copied into a temporary location on your path. On termination, they are deleted.
+
+
+### Build from MXNET Source
+
+Checkout the latest sha from the main package
+
+`git clone --recursive https://github.com/dmlc/mxnet ~/mxnet`
+`cd ~/mxnet`
+
+If you need to checkout a particular release you can do it with:
+
+`git checkout tags/1.2.1 -b release-1.2.1`
+
+`git submodule update --init --recursive`
+
+Sometimes it useful to use this script to clean hard
+https://gist.github.com/nicktoumpelis/11214362
+
+
+Go here to do the base package installation https://mxnet.incubator.apache.org/install/index.html
+
+ Run `make scalapkg` then `make scalainstall`
+
+then replace the correct jar for your architecture in the project.clj, example `[ml.dmlc.mxnet/mxnet-full_2.11-osx-x86_64-cpu "1.3.0-SNAPSHOT"]`
 
 Review comment:
   org.apache instead?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services