
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Ruby bindings for Tensorflow.
First you'll need to install Tensorflow 2. You can either do a full installation or just install Tensorflow for C. In both cases, you'll need to make sure the tensorflow library is on the system PATH so the Ruby bindings can load it.
Next install the gem:
gem install 'tensorflow-ruby'
The Ruby bindings are on built on top of TensorFlow's [C API] (https://github.com/tensorflow/docs/blob/master/site/en/r1/guide/extend/bindings.md)
which provides access to some, but not all, of TensorFlow's functionality. The Ruby bindings
are designed to mimic the Python API. Just like the
Python bindings, Ruby defaults to eager execution mode.
Feature | Status |
---|---|
Run a predefined Graph | Implemented |
Graph construction with generated op functions | Implemented |
Gradients | Implemented |
Functions | Implemented |
Trainers | Gradient Descent Implemented |
Data API | 80% Implemented |
Tensorboard Support | Implemented |
Control Flow | Not Implemented |
Gradient Tape | Not Implemented |
Keras | Not Implemented |
To learn how to use the library:
Constants are
a = Tf.constant([1, 2, 3])
b = Tf.constant([4, 5, 6])
a + b
v = Tf::Variable.new(0.0)
w = v + 1
Tf::Math.abs([-1, -2])
Tf::Math.sqrt([1.0, 4.0, 9.0])
# load
train_dataset = Tf::Data::Dataset.from_tensor_slices([train_examples, train_labels])
test_dataset = Tf::Data::Dataset.from_tensor_slices([test_examples, test_labels])
# shuffle and batch
train_dataset = train_dataset.shuffle(100).batch(32)
test_dataset = test_dataset.batch(32)
# iterate
train_dataset.each do |examples, labels|
# ...
end
Everyone is encouraged to help improve this project. Here are a few ways you can help:
To get started with development and testing:
git clone https://github.com/cfis/tensorflow-ruby.git
cd tensorflow-ruby
bundle install
rake test
FAQs
Unknown package
We found that tensorflow-ruby demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.