README.md in tensorflow-0.1.1 vs README.md in tensorflow-0.1.2

- old
+ new

@@ -37,10 +37,17 @@ ```ruby v = Tf::Variable.new(0.0) w = v + 1 ``` +## Math + +```ruby +Tf::Math.abs(-2) +Tf::Math.sqrt(4) +``` + ## FizzBuzz ```ruby def fizzbuzz(max_num) max_num.times do |i| @@ -58,14 +65,29 @@ end fizzbuzz(15) ``` -## Keras +## Data::Dataset -Coming soon +```ruby +# 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 +``` + +## Keras [coming soon] + ```ruby mnist = Tf::Keras::Datasets::MNIST (x_train, y_train), (x_test, y_test) = mnist.load_data x_train = x_train / 255.0 x_test = x_test / 255.0 @@ -112,5 +134,14 @@ - [Report bugs](https://github.com/ankane/tensorflow/issues) - Fix bugs and [submit pull requests](https://github.com/ankane/tensorflow/pulls) - Write, clarify, or fix documentation - Suggest or add new features + +To get started with development and testing: + +```sh +git clone https://github.com/ankane/tensorflow.git +cd tensorflow +bundle install +rake test +```