Giter VIP home page Giter VIP logo

jumpy's Introduction

Jumpy: Python interface for nd4j

Join the chat at https://gitter.im/deeplearning4j/deeplearning4j

Jumpy allows you to use nd4j from python via pointers (no network communication required like a lot of python libraries).

Installation

Jumpy requires an uber jar (a jar file that contains nd4j and all its dependencies) and the path to this file is expected to be found in the environment variable JUMPY_CLASS_PATH.

Easiest way to build the uber jar is by running mvn package on the pom.xml file:

git clone https://www.github.com/deeplearning4j/jumpy.git
cd jumpy
mvn package

This will create a jar file called dl4j-1.0.0-SNAPSHOT.jar in the target directory. Set JUMPY_CLASS_PATH environment variable to path of this file.

export JUMPY_CLASS_PATH='/...../jumpy/target/dl4j-1.0.0-SNAPSHOT.jar'

Finally, either install jumpy via pip:

pip install jumpy

Or from source:

python setup.py install

Using Jumpy

Creating arrays

Just like numpy, you can initialize an array using .zeros() or .ones()

import jumpy as jp

x = jp.zeros((32, 16))
y = jp.ones((32, 16))

Converting numpy array to jumpy array

A numpy ndarray instance can be converted to a jumpy ndarray instance (and vice-versa) without copying the data

import jumpy as jp
import numpy as np

x_np = np.random.random((100, 50))
x_jp = jp.array(x_np)

Converting jumpy array to numpy array

Simply call the .numpy() method of jumpy.ndarray.ndarray

import jumpy as jp

x_jp = jp.zeros((100,50))
x_np = x_jp.numpy()

Operations

  • Basic operators like + - * / += -= *= /= are overloaded and broadcasting is supported.
  • Indexing, slicing and assignment behaviour has been made as close to numpy as possible.
  • Check jumpy/ops/ to see available ops.

Contribute

  • Check for open issues, or open a new issue to start a discussion around a feature idea or a bug.
  • We could use more ops! Have a look at available ops (jumpy/ops/), it's quite easy to add new ones.
  • Send a pull request and bug us on Gitter until it gets merged and published. :)

jumpy's People

Contributors

chrisvnicholson avatar farizrahman4u avatar huitseeker avatar maxpumperla avatar raver119 avatar saudet avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.