Rust binding of primitiv

Overview

Rust frontend of primitiv

Prerequisites

  • Rust (1.26 or later)
  • Clang (3.9 or later)
  • (optional) CUDA (8.0 or later)

Install

mkdir work
cd work

# build primitiv-rust
git clone --branch develop https://github.com/primitiv/primitiv-rust/
cd primitiv-rust
cargo build [--features cuda]

# try xor example
cargo run --example xor
You might also like...
Machine learning crate for Rust

rustlearn A machine learning package for Rust. For full usage details, see the API documentation. Introduction This crate contains reasonably effectiv

Rust bindings for the C++ api of PyTorch.

tch-rs Rust bindings for the C++ api of PyTorch. The goal of the tch crate is to provide some thin wrappers around the C++ PyTorch api (a.k.a. libtorc

个人的 rust 学习资料

🔝 通知: 项目文档迁移到: https://github.com/higker/learn-rust learning-rust-zh 个人的 rust 学习资料 学习目录 目录 源代码地址 相关解析 第一个rust程序 https://github.com/higker/learning-ru

Distributed compute platform implemented in Rust, and powered by Apache Arrow.
Distributed compute platform implemented in Rust, and powered by Apache Arrow.

Ballista: Distributed Compute Platform Overview Ballista is a distributed compute platform primarily implemented in Rust, powered by Apache Arrow. It

Tensors and differentiable operations (like TensorFlow) in Rust

autograd Differentiable operations and tensors backed by ndarray. Motivation Machine learning is one of the field where Rust lagging behind other lang

Rust numeric library with R, MATLAB & Python syntax

Peroxide Rust numeric library contains linear algebra, numerical analysis, statistics and machine learning tools with R, MATLAB, Python like macros. W

A fast, safe and easy to use reinforcement learning framework in Rust.
A fast, safe and easy to use reinforcement learning framework in Rust.

RSRL (api) Reinforcement learning should be fast, safe and easy to use. Overview rsrl provides generic constructs for reinforcement learning (RL) expe

Neural networks in Rust

deeplearn-rs Deep learning in Rust! This is my first shot at this. It's mostly just a proof of concept right now. The API will change. Status We have

A deep learning library for rust

Alumina An experimental deep learning library written in pure rust. Breakage expected on each release in the short term. See mnist.rs in examples or R

Comments
  • Compile error due to wrong commit hash

    Compile error due to wrong commit hash

    Hi.

    I tried to install primitiv-rust. cargo build failed with following error:

       Compiling cexpr v0.2.3
       Compiling env_logger v0.4.3
       Compiling primitiv-sys v0.3.0 (file:///Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/primitiv-sys)
    error: failed to run custom build command for `primitiv-sys v0.3.0 (file:///Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/primitiv-sys)`
    process didn't exit successfully: `/Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/target/debug/build/primitiv-sys-414555f0b7236a02/build-script-build` (exit code: 101)
    --- stdout
    primitiv-sys/build.rs:65: out_dir = "/Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/target/debug/build/primitiv-sys-e8fd6c3c83e9f738/out/lib-1ea9ba875ace79ca884ab448d7c0842d78d4b18d"
    primitiv-sys/build.rs:70: framework_library_path = "/Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/target/debug/build/primitiv-sys-e8fd6c3c83e9f738/out/lib-1ea9ba875ace79ca884ab448d7c0842d78d4b18d/lib/libprimitiv.so"
    primitiv-sys/build.rs:72: library_path = "/Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/target/debug/build/primitiv-sys-e8fd6c3c83e9f738/out/lib-1ea9ba875ace79ca884ab448d7c0842d78d4b18d/lib/libprimitiv_c.so"
    primitiv-sys/build.rs:82: source = "/Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/primitiv-sys/target/source-1ea9ba875ace79ca884ab448d7c0842d78d4b18d"
    primitiv-sys/build.rs:153: Executing "git" "clone" "--depth=1" "https://github.com/primitiv/primitiv" "/Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/primitiv-sys/target/source-1ea9ba875ace79ca884ab448d7c0842d78d4b18d"
    primitiv-sys/build.rs:157: Command "git" "clone" "--depth=1" "https://github.com/primitiv/primitiv" "/Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/primitiv-sys/target/source-1ea9ba875ace79ca884ab448d7c0842d78d4b18d" finished successfully
    primitiv-sys/build.rs:153: Executing "git" "--git-dir=/Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/primitiv-sys/target/source-1ea9ba875ace79ca884ab448d7c0842d78d4b18d/.git" "checkout" "1ea9ba875ace79ca884ab448d7c0842d78d4b18d"
    
    --- stderr
    Cloning into '/Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/primitiv-sys/target/source-1ea9ba875ace79ca884ab448d7c0842d78d4b18d'...
    fatal: reference is not a tree: 1ea9ba875ace79ca884ab448d7c0842d78d4b18d
    thread 'main' panicked at 'failed to execute "git" "--git-dir=/Users/takeshi.okada/src/github.com/primitiv/primitiv-rust/primitiv-sys/target/source-1ea9ba875ace79ca884ab448d7c0842d78d4b18d/.git" "checkout" "1ea9ba875ace79ca884ab448d7c0842d78d4b18d"', primitiv-sys/build.rs:155:9
    note: Run with `RUST_BACKTRACE=1` for a backtrace.
    

    The following diff solved the error and xor example seems works well:

    $  git diff
    diff --git a/primitiv-sys/build.rs b/primitiv-sys/build.rs
    index 6fa4df2..0b16a9f 100644
    --- a/primitiv-sys/build.rs
    +++ b/primitiv-sys/build.rs
    @@ -10,7 +10,7 @@ use std::result::Result;
     const FRAMEWORK_LIBRARY: &'static str = "primitiv";
     const LIBRARY: &'static str = "primitiv_c";
     const REPOSITORY: &'static str = "https://github.com/primitiv/primitiv";
    -const TAG: &'static str = "1ea9ba875ace79ca884ab448d7c0842d78d4b18d";
    +const TAG: &'static str = "develop";
    
     macro_rules! log {
         ($fmt:expr) => (println!(concat!("primitiv-sys/build.rs:{}: ", $fmt), line!()));
    
    bug: minor 
    opened by kenoss 2
  • Refine APIs

    Refine APIs

    This PR refines APIs and adds several features.

    • Features

      • add abs, max, min and batch-ops functions
      • add derive(Model) proc_macro
      • support serialization
    • Enhancement

      • use NonNull for handle pointers
      • update dependencies
      • implement From instead of Into
      • reimplement generic functions for Node and Tensor
      • return Option from some functions
      • implement Default trait
      • update examples
      • update formatting
    • Bugfix

      • string memory allocation
      • Sized trait bounds
    enhancement bug: minor 
    opened by chantera 0
  • Fix git clone argument.

    Fix git clone argument.

    Related to #6 This PR fixes wrong git clone option --depth=1. With --depth option, a repository is cloned with a history truncated to the specified number of revisions. Then git checkout command with an older revision number fails because the shallow repository does not include it. This PR removes --depth option to clone a repository without truncating a history.

    opened by chantera 0
Owner
primitiv
primitiv
LightGBM Rust binding

lightgbm-rs LightGBM Rust binding Require You need an environment that can build LightGBM. # linux apt install -y cmake libclang-dev libc++-dev gcc-mu

vaaaaanquish 42 Dec 15, 2022
Rust binding to LuisaCompute (WIP)

luisa-compute-rs Rust binding to LuisaCompute (WIP) Inside this crate: An almost safe binding to LuisaCompute An EDSL for writing kernels A new backen

Luisa Group 14 Jan 5, 2023
Msgpack serialization/deserialization library for Python, written in Rust using PyO3, and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Aviram Hassan 139 Dec 30, 2022
Practice repo for learning Rust. Currently going through "Rust for JavaScript Developers" course.

rust-practice ?? Practice repo for learning Rust. Directories /rust-for-js-dev Files directed towards "Rust for JavaScript Developers" course. Thank y

Sammy Samkough 0 Dec 25, 2021
A Rust library with homemade machine learning models to classify the MNIST dataset. Built in an attempt to get familiar with advanced Rust concepts.

mnist-classifier Ideas UPDATED: Finish CLI Flags Parallelize conputationally intensive functions Class-based naive bayes README Image parsing Confusio

Neil Kaushikkar 0 Sep 2, 2021
🦀Rust Turkiye - Rust Dersleri

Rust Turkiye - Rust Dersleri CURIOSITY - Featuring Richard Feynman Bu repo Rust Turkiye tarafindan duzenlenen Rust Dersleri egitiminin alistirma ve ko

Theo M. Bulut 12 Jan 14, 2023
A Rust machine learning framework.

Linfa linfa (Italian) / sap (English): The vital circulating fluid of a plant. linfa aims to provide a comprehensive toolkit to build Machine Learning

Rust-ML 2.2k Jan 2, 2023
Machine Learning library for Rust

rusty-machine This library is no longer actively maintained. The crate is currently on version 0.5.4. Read the API Documentation to learn more. And he

James Lucas 1.2k Dec 31, 2022
Rust library for Self Organising Maps (SOM).

RusticSOM Rust library for Self Organising Maps (SOM). Using this Crate Add rusticsom as a dependency in Cargo.toml [dependencies] rusticsom = "1.1.0"

Avinash Shenoy 26 Oct 17, 2022
Rust language bindings for TensorFlow

TensorFlow Rust provides idiomatic Rust language bindings for TensorFlow. Notice: This project is still under active development and not guaranteed to

null 4.1k Jan 1, 2023