Code Monkey home page Code Monkey logo

tensorposit's Introduction

Instructions for compilation

Install right version of bazel:

wget https://releases.bazel.build/3.7.2/release/bazel-3.7.2-installer-linux-x86_64.sh
chmod +x bazel-3.7.2-installer-linux-x86_64.sh
sudo ./bazel-3.7.2-installer-linux-x86_64.sh
source /usr/local/lib/bazel/bin/bazel-complete.bash

Install python dependencies:

pip install numpy==1.19.5 
pip install keras_preprocessing==1.1.2

Build package tool (the actual tensorflow):

bazel build //tensorflow/tools/pip_package:build_pip_package

Build the python wheel NOTE: wheel will be placed in the folder, change it to a valid path

./bazel-bin/tensorflow/tools/pip_package/build_pip_package <dst-folder>

After compilation

Install python wheel (move to another folder or create a virtual environment )

python3 -m venv tf_env
source tf_env/bin/activate
pip install protobuf==3.20.1
pip install <wheel-file>

Use tensorposit in python scripts:

# This may generate some warnings, you can ignore it
import tensorflow as tf
from tensorflow.python import keras

# Set default floatx
keras.backend.set_floatx("posit160")

# Or create a tensor of posits
tp = tf.ones((10,10), dtype=tf.posit160)

NOTE: posit160 is just a name for the internal posit type (I hope to change it to "posit" in the near future). The default posit configuration is Posit16,2.

In the releases you can find prebuilt Posit16,2 and Posit8,2 wheels as separate installation. In the future I may want to put them together as posit16 and posit8 dtypes inside tensorflow.

tensorposit's People

Contributors

federicorossifr avatar mrfransis avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

mrfransis

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.