Git Product home page Git Product logo

tfd's Introduction

tfd: tensorflow for D

linux windows codecov Dub version

Installation

  • If your project needs only TF C API bindings: $ dub add tfd:deimos
  • If your project needs entire tfd packages: $ dub add tfd

see also Requirements

Example

Mir is to tfd what NumPy is to Tensorflow.

/// tensor add

import tfd;
import mir.ndslice : as, iota;

with (newGraph)
{
  auto i = iota(2, 3, 4).as!float;

  Operation x = placeholder!float("x", 2, 3, 4);
  Operation two = constant(i);
  Operation add = x + two;

  Tensor addVal = session.run([add], [x: i.tensor])[0];
  assert(addVal.sliced!(float, 3) == i * 2);
}

And more:

Features

  • dpp generated C API bindings
  • Support @nogc nothrow.
  • Setup CI
  • Wrap tensor and session for basic usages (see tfd.session unittests).
  • mir.ndslice.Slice s <=> tfd.tensor.Tensor t integration by s.tensor, t.slicedAs(s).
  • Example to save/load TF graphs.
  • Use pbd to save/load proto files.
  • Parse ops.pbtxt to generate typed ops bindings.
  • Rewrite C API example with typed bindings.
  • Implement autograd, and simple training APIs in D.
  • Support cloud TPU.
  • Support dip1000.

Requirements

Re-generate bindings

tfd uses dpp to generate bindings from TF C-API. You need libclang to run dpp.

dub fetch dpp
dub run dpp -- --preprocess-only --include-path ./download/include <target dpp file>

tfd's People

Contributors

shigekikarita avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

laeeth lempiji

tfd's Issues

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.