tensor_stream 0.8.1 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +8 -0
  4. data/README.md +12 -6
  5. data/lib/tensor_stream.rb +1 -0
  6. data/lib/tensor_stream/evaluator/base_evaluator.rb +1 -1
  7. data/lib/tensor_stream/evaluator/ruby/array_ops.rb +282 -0
  8. data/lib/tensor_stream/evaluator/ruby/images_ops.rb +61 -0
  9. data/lib/tensor_stream/evaluator/ruby/math_ops.rb +111 -0
  10. data/lib/tensor_stream/evaluator/ruby/nn_ops.rb +48 -9
  11. data/lib/tensor_stream/evaluator/ruby/random_ops.rb +51 -0
  12. data/lib/tensor_stream/evaluator/ruby_evaluator.rb +20 -433
  13. data/lib/tensor_stream/images.rb +16 -0
  14. data/lib/tensor_stream/ops.rb +5 -1
  15. data/lib/tensor_stream/session.rb +15 -15
  16. data/lib/tensor_stream/tensor.rb +1 -1
  17. data/lib/tensor_stream/train/adadelta_optimizer.rb +52 -0
  18. data/lib/tensor_stream/train/adam_optimizer.rb +17 -2
  19. data/lib/tensor_stream/train/gradient_descent_optimizer.rb +7 -1
  20. data/lib/tensor_stream/trainer.rb +1 -0
  21. data/lib/tensor_stream/types.rb +4 -0
  22. data/lib/tensor_stream/utils.rb +4 -0
  23. data/lib/tensor_stream/variable_scope.rb +1 -0
  24. data/lib/tensor_stream/version.rb +1 -1
  25. data/samples/linear_regression.rb +4 -1
  26. data/samples/mnist_data.rb +64 -0
  27. data/samples/nearest_neighbor.rb +1 -2
  28. data/samples/raw_neural_net_sample.rb +1 -1
  29. data/tensor_stream.gemspec +1 -0
  30. metadata +23 -57
  31. data/lib/tensor_stream/evaluator/opencl/kernels/_bool_operand.cl +0 -45
  32. data/lib/tensor_stream/evaluator/opencl/kernels/_operand.cl +0 -45
  33. data/lib/tensor_stream/evaluator/opencl/kernels/abs.cl +0 -20
  34. data/lib/tensor_stream/evaluator/opencl/kernels/acos.cl +0 -8
  35. data/lib/tensor_stream/evaluator/opencl/kernels/add.cl +0 -3
  36. data/lib/tensor_stream/evaluator/opencl/kernels/apply_adam.cl +0 -23
  37. data/lib/tensor_stream/evaluator/opencl/kernels/apply_gradient.cl +0 -9
  38. data/lib/tensor_stream/evaluator/opencl/kernels/apply_momentum.cl +0 -16
  39. data/lib/tensor_stream/evaluator/opencl/kernels/argmax.cl +0 -8
  40. data/lib/tensor_stream/evaluator/opencl/kernels/argmin.cl +0 -8
  41. data/lib/tensor_stream/evaluator/opencl/kernels/asin.cl +0 -9
  42. data/lib/tensor_stream/evaluator/opencl/kernels/cast.cl +0 -10
  43. data/lib/tensor_stream/evaluator/opencl/kernels/ceil.cl +0 -8
  44. data/lib/tensor_stream/evaluator/opencl/kernels/cond.cl.erb +0 -6
  45. data/lib/tensor_stream/evaluator/opencl/kernels/cos.cl +0 -8
  46. data/lib/tensor_stream/evaluator/opencl/kernels/div.cl.erb +0 -3
  47. data/lib/tensor_stream/evaluator/opencl/kernels/exp.cl +0 -8
  48. data/lib/tensor_stream/evaluator/opencl/kernels/floor.cl +0 -8
  49. data/lib/tensor_stream/evaluator/opencl/kernels/floor_div.cl +0 -48
  50. data/lib/tensor_stream/evaluator/opencl/kernels/floor_mod.cl +0 -3
  51. data/lib/tensor_stream/evaluator/opencl/kernels/gemm.cl +0 -32
  52. data/lib/tensor_stream/evaluator/opencl/kernels/log.cl +0 -8
  53. data/lib/tensor_stream/evaluator/opencl/kernels/log1p.cl +0 -8
  54. data/lib/tensor_stream/evaluator/opencl/kernels/log_softmax.cl +0 -26
  55. data/lib/tensor_stream/evaluator/opencl/kernels/max.cl +0 -46
  56. data/lib/tensor_stream/evaluator/opencl/kernels/min.cl +0 -46
  57. data/lib/tensor_stream/evaluator/opencl/kernels/mod.cl +0 -3
  58. data/lib/tensor_stream/evaluator/opencl/kernels/mul.cl +0 -3
  59. data/lib/tensor_stream/evaluator/opencl/kernels/negate.cl +0 -8
  60. data/lib/tensor_stream/evaluator/opencl/kernels/pack.cl +0 -24
  61. data/lib/tensor_stream/evaluator/opencl/kernels/pow.cl +0 -46
  62. data/lib/tensor_stream/evaluator/opencl/kernels/real_div.cl +0 -3
  63. data/lib/tensor_stream/evaluator/opencl/kernels/reciprocal.cl +0 -8
  64. data/lib/tensor_stream/evaluator/opencl/kernels/round.cl +0 -8
  65. data/lib/tensor_stream/evaluator/opencl/kernels/sigmoid.cl +0 -9
  66. data/lib/tensor_stream/evaluator/opencl/kernels/sigmoid_grad.cl +0 -55
  67. data/lib/tensor_stream/evaluator/opencl/kernels/sign.cl +0 -21
  68. data/lib/tensor_stream/evaluator/opencl/kernels/sin.cl +0 -9
  69. data/lib/tensor_stream/evaluator/opencl/kernels/softmax.cl +0 -26
  70. data/lib/tensor_stream/evaluator/opencl/kernels/softmax_cross.cl +0 -32
  71. data/lib/tensor_stream/evaluator/opencl/kernels/softmax_cross_grad.cl +0 -28
  72. data/lib/tensor_stream/evaluator/opencl/kernels/softmax_grad.cl +0 -46
  73. data/lib/tensor_stream/evaluator/opencl/kernels/sqrt.cl +0 -9
  74. data/lib/tensor_stream/evaluator/opencl/kernels/square.cl +0 -9
  75. data/lib/tensor_stream/evaluator/opencl/kernels/squared_difference.cl +0 -53
  76. data/lib/tensor_stream/evaluator/opencl/kernels/sub.cl +0 -3
  77. data/lib/tensor_stream/evaluator/opencl/kernels/tan.cl +0 -8
  78. data/lib/tensor_stream/evaluator/opencl/kernels/tanh.cl +0 -8
  79. data/lib/tensor_stream/evaluator/opencl/kernels/tanh_grad.cl +0 -7
  80. data/lib/tensor_stream/evaluator/opencl/kernels/where.cl +0 -8
  81. data/lib/tensor_stream/evaluator/opencl/opencl_buffer.rb +0 -35
  82. data/lib/tensor_stream/evaluator/opencl/opencl_device.rb +0 -5
  83. data/lib/tensor_stream/evaluator/opencl/opencl_evaluator.rb +0 -1230
  84. data/lib/tensor_stream/evaluator/opencl/opencl_template_helper.rb +0 -95
@@ -0,0 +1,16 @@
1
+ module TensorStream
2
+ module Images
3
+ extend OpHelper
4
+ extend TensorStream::Utils
5
+
6
+ def self.decode_png(contents, channels: 0, dtype: :uint8, name: nil)
7
+ _op(:decode_png, contents, channels: channels, data_type: dtype, name: name)
8
+ end
9
+
10
+ def self.encode_png(contents, compression: -1, name: nil)
11
+ check_allowed_types(contents, [:uint8, :uint16])
12
+ contents = convert_to_tensor(contents, dtype: :uint16)
13
+ _op(:encode_png, contents, compression: compression, name: name)
14
+ end
15
+ end
16
+ end
@@ -2,7 +2,7 @@ module TensorStream
2
2
  # Class that defines all available ops supported by TensorStream
3
3
  module Ops
4
4
  FLOATING_POINT_TYPES = %i[float32 float64 float].freeze
5
- INTEGER_TYPES = %i[int32 int int64].freeze
5
+ INTEGER_TYPES = %i[uint8 int32 int int64].freeze
6
6
  NUMERIC_TYPES = FLOATING_POINT_TYPES + INTEGER_TYPES
7
7
 
8
8
  ##
@@ -634,6 +634,10 @@ module TensorStream
634
634
  _op(:stack, *values, axis: axis, name: name)
635
635
  end
636
636
 
637
+ def squeeze(value, axis: [], name: nil)
638
+ _op(:squeeze, value, axis: axis, name: nil)
639
+ end
640
+
637
641
  def setdiff1d(x, y, index_dtype: :int32, name: nil)
638
642
  result = _op(:setdiff1d, x, y, index_dtype: index_dtype, name: name)
639
643
  [result[0], result[1]]
@@ -124,21 +124,6 @@ module TensorStream
124
124
  end
125
125
  end
126
126
 
127
- protected
128
-
129
- def run_with_session_context(tensor, session_context, context)
130
- session_context[:_cache][:placement][tensor.name] = assign_evaluator(tensor) if session_context[:_cache][:placement][tensor.name].nil?
131
- session_context[:_cache][:placement][tensor.name][1].run_with_buffer(tensor, session_context, context)
132
- end
133
-
134
- def recursive_eval(value, depth = 2)
135
- if value.is_a?(Array) && depth > 0
136
- value.collect { |v| recursive_eval(v, depth - 1) }
137
- else
138
- value.respond_to?(:to_ruby) ? value.to_ruby : value
139
- end
140
- end
141
-
142
127
  def assign_evaluator(tensor)
143
128
  device = @evaluator_classes.map do |klass|
144
129
  next nil if tensor.is_a?(Operation) && !klass.ops.include?(tensor.operation.to_sym)
@@ -157,6 +142,21 @@ module TensorStream
157
142
  end
158
143
  end
159
144
 
145
+ protected
146
+
147
+ def run_with_session_context(tensor, session_context, context)
148
+ session_context[:_cache][:placement][tensor.name] = assign_evaluator(tensor) if session_context[:_cache][:placement][tensor.name].nil?
149
+ session_context[:_cache][:placement][tensor.name][1].run_with_buffer(tensor, session_context, context)
150
+ end
151
+
152
+ def recursive_eval(value, depth = 2)
153
+ if value.is_a?(Array) && depth > 0
154
+ value.collect { |v| recursive_eval(v, depth - 1) }
155
+ else
156
+ value.respond_to?(:to_ruby) ? value.to_ruby : value
157
+ end
158
+ end
159
+
160
160
  def prepare_evaluators(tensor_arr, context)
161
161
  context[:_cache][:placement] ||= {}
162
162
 
@@ -260,7 +260,7 @@ module TensorStream
260
260
  end
261
261
  when :string
262
262
  val.to_s
263
- when :int32, :int16, :int
263
+ when :int32, :int16, :uint8, :int
264
264
  if !!val == val
265
265
  val ? 1 : 0
266
266
  else
@@ -0,0 +1,52 @@
1
+ module TensorStream
2
+ module Train
3
+ # High Level implementation of the Adadelta algorithm
4
+ class AdadeltaOptimizer < Optimizer
5
+ include TensorStream::OpHelper
6
+
7
+ attr_accessor :learning_rate
8
+
9
+ def initialize(learning_rate = 0.001, rho = 0.95, epsilon = 1e-8,
10
+ use_locking: false, name: "Adadelta")
11
+ @learning_rate = learning_rate
12
+ @rho = rho
13
+ @epsilon = epsilon
14
+
15
+ # Tensor versions of the constructor arguments, created in _prepare().
16
+ @learning_rate_tensor = nil
17
+ @rho_t = nil
18
+ @epsilon_t = nil
19
+ super(name: name, use_locking: use_locking)
20
+ end
21
+
22
+ protected
23
+
24
+ def create_slots(var_list)
25
+ var_list.each do |v|
26
+ zeros_slot(v, "accum", @name)
27
+ zeros_slot(v, "accum_update", @name)
28
+ end
29
+ end
30
+
31
+ def prepare
32
+ @learning_rate_tensor = convert_to_tensor(@learning_rate, name: "lr")
33
+ @rho_t = convert_to_tensor(@rho, name: "rho")
34
+ @epsilon_t = convert_to_tensor(@epsilon, name: "epsilon")
35
+ end
36
+
37
+ def apply_dense(grad, var)
38
+ accum = get_slot(var, "accum")
39
+ accum_update = get_slot(var, "accum_update")
40
+ _op(:apply_adadelta,
41
+ var,
42
+ accum,
43
+ accum_update,
44
+ TensorStream.cast(@learning_rate_tensor, var.data_type),
45
+ TensorStream.cast(@rho_t, var.data_type),
46
+ TensorStream.cast(@epsilon_t, var.data_type),
47
+ grad,
48
+ use_locking: @use_locking)
49
+ end
50
+ end
51
+ end
52
+ end
@@ -1,12 +1,27 @@
1
1
  module TensorStream
2
2
  module Train
3
- # High Level implementation of the gradient descent algorithm
3
+ # High Level implementation of the ADAM algorithm
4
4
  class AdamOptimizer < Optimizer
5
5
  include TensorStream::OpHelper
6
6
 
7
7
  attr_accessor :learning_rate
8
8
 
9
- def initialize(learning_rate = 0.001, beta1=0.9, beta2=0.999, epsilon = 1e-8,
9
+ ##
10
+ # Construct a new Adam optimizer.
11
+ #
12
+ # Args:
13
+ # learning_rate: A Tensor or a floating point value. The learning rate.
14
+ # beta1: A float value or a constant float tensor.
15
+ # The exponential decay rate for the 1st moment estimates.
16
+ # beta2: A float value or a constant float tensor.
17
+ # The exponential decay rate for the 2nd moment estimates.
18
+ # epsilon: A small constant for numerical stability. This epsilon is
19
+ # "epsilon hat" in the Kingma and Ba paper (in the formula just before
20
+ # Section 2.1), not the epsilon in Algorithm 1 of the paper.
21
+ # use_locking: If True use locks for update operations.
22
+ # name: Optional name for the operations created when applying gradients.
23
+ # Defaults to "Adam".
24
+ def initialize(learning_rate = 0.001, beta1 = 0.9, beta2 = 0.999, epsilon = 1e-8,
10
25
  use_locking: false, name: "Adam")
11
26
  @learning_rate = learning_rate
12
27
  @beta1 = beta1
@@ -8,13 +8,19 @@ module TensorStream
8
8
 
9
9
  def initialize(learning_rate, use_locking: false, name: "GradientDescent")
10
10
  @learning_rate = learning_rate
11
+ @learning_rate_tensor = nil
11
12
  super(name: name, use_locking: use_locking)
12
13
  end
13
14
 
14
15
  protected
15
16
 
17
+ def prepare
18
+ learning_rate = call_if_callable(@learning_rate)
19
+ @learning_rate_tensor = convert_to_tensor(learning_rate, name: "learning_rate")
20
+ end
21
+
16
22
  def apply_dense(grad, var)
17
- i_op(:apply_gradient_descent, var, TensorStream.cast(@learning_rate, grad.data_type), grad)
23
+ i_op(:apply_gradient_descent, var, TensorStream.cast(@learning_rate_tensor, grad.data_type), grad)
18
24
  end
19
25
  end
20
26
  end
@@ -3,6 +3,7 @@ require 'tensor_stream/train/optimizer'
3
3
  require 'tensor_stream/train/gradient_descent_optimizer'
4
4
  require 'tensor_stream/train/momentum_optimizer'
5
5
  require 'tensor_stream/train/adam_optimizer'
6
+ require 'tensor_stream/train/adadelta_optimizer'
6
7
  require 'tensor_stream/train/saver'
7
8
 
8
9
  module TensorStream
@@ -15,6 +15,10 @@ module TensorStream
15
15
  :int32
16
16
  end
17
17
 
18
+ def self.uint8
19
+ :uint8
20
+ end
21
+
18
22
  def self.float64
19
23
  :float64
20
24
  end
@@ -206,6 +206,10 @@ module TensorStream
206
206
  TensorStream::Trainer
207
207
  end
208
208
 
209
+ def image
210
+ TensorStream::Images
211
+ end
212
+
209
213
  def trainable_variables
210
214
  TensorStream.get_default_graph.get_collection(TensorStream::GraphKeys::TRAINABLE_VARIABLES)
211
215
  end
@@ -11,6 +11,7 @@ module TensorStream
11
11
  end
12
12
 
13
13
  def get_variable(name, dtype: nil, shape: nil, initializer: nil, trainable: true, collections: nil, validate_shape: false)
14
+ raise TensorStream::ValueError, "validate_shape=true and initializer does not have a defined shape" if validate_shape && !shape.nil && initializer.is_a?(Tensor)
14
15
  TensorStream::Variable.new(dtype || :float32, nil, shape, self, collections: collections, name: name, initializer: initializer, trainable: trainable)
15
16
  end
16
17
 
@@ -1,5 +1,5 @@
1
1
  module TensorStream
2
- VERSION = '0.8.1'.freeze
2
+ VERSION = '0.8.5'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -1,5 +1,5 @@
1
1
  # Linear Regression sample, using SGD and auto-differentiation
2
-
2
+ require "bundler/setup"
3
3
  require 'tensor_stream'
4
4
 
5
5
  tf = TensorStream # use tf to make it look like TensorFlow
@@ -20,6 +20,7 @@ X = tf.placeholder("float")
20
20
  Y = tf.placeholder("float")
21
21
 
22
22
  # Set model weights
23
+
23
24
  W = tf.variable(rand, name: "weight")
24
25
  b = tf.variable(rand, name: "bias")
25
26
 
@@ -32,8 +33,10 @@ cost = ((pred - Y) ** 2).reduce(:+) / ( 2 * n_samples)
32
33
  # Other possible Optimizers
33
34
  # optimizer = TensorStream::Train::MomentumOptimizer.new(learning_rate, momentum, use_nesterov: true).minimize(cost)
34
35
  # optimizer = TensorStream::Train::AdamOptimizer.new(learning_rate).minimize(cost)
36
+ # optimizer = TensorStream::Train::AdadeltaOptimizer.new(1.0).minimize(cost)
35
37
  optimizer = TensorStream::Train::GradientDescentOptimizer.new(learning_rate).minimize(cost)
36
38
 
39
+
37
40
  # Initialize the variables (i.e. assign their default value)
38
41
  init = tf.global_variables_initializer()
39
42
 
@@ -0,0 +1,64 @@
1
+ # A ruby port of the example code discussed by Martin Gorner in
2
+ # "TensorFlow and Deep Learning without a PhD, Part 1 (Google Cloud Next '17)""
3
+ #
4
+ # https://www.youtube.com/watch?v=u4alGiomYP4
5
+ #
6
+ # Requirements:
7
+ # mnist-learn gem
8
+ # opencl_ruby_ffi gem
9
+ require "bundler/setup"
10
+ require 'tensor_stream'
11
+ require 'mnist-learn'
12
+
13
+ # Enable OpenCL hardware accelerated computation, not using OpenCL can be very slow
14
+ require 'tensor_stream/evaluator/opencl/opencl_evaluator'
15
+
16
+ tf = TensorStream
17
+
18
+ # Import MNIST data
19
+ puts "downloading minst data"
20
+ mnist = Mnist.read_data_sets('/tmp/data', one_hot: true)
21
+ puts "downloading finished"
22
+
23
+ x = tf.placeholder(:float32, shape: [nil, 28, 28, 1])
24
+ w = tf.variable(tf.zeros([784, 10]))
25
+ b = tf.variable(tf.zeros([10]))
26
+
27
+ init = tf.global_variables_initializer
28
+
29
+ # model
30
+ y = tf.nn.softmax(tf.matmul(tf.reshape(x, [-1, 784]), w) + b)
31
+
32
+ y_ = tf.placeholder(:float32, shape: [nil, 10])
33
+
34
+ # loss function
35
+ cross_entropy = -tf.reduce_sum(y_ * tf.log(y))
36
+
37
+ is_correct = tf.equal(tf.argmax(y, 1), tf.argmax(y_, 1))
38
+ accuracy = tf.reduce_mean(tf.cast(is_correct, :float32))
39
+
40
+ optimizer = TensorStream::Train::GradientDescentOptimizer.new(0.01)
41
+ train_step = optimizer.minimize(cross_entropy)
42
+
43
+ sess = tf.session
44
+ sess.run(init)
45
+
46
+ (0...1000).each do |i|
47
+ # load batch of images and correct answers
48
+ batch_x, batch_y = mnist.train.next_batch(100)
49
+ train_data = { x => batch_x, y_ => batch_y }
50
+
51
+ # train
52
+ sess.run(train_step, feed_dict: train_data)
53
+ if (i % 10 == 0)
54
+ # success? add code to print it
55
+ a, c = sess.run([accuracy, cross_entropy], feed_dict: train_data)
56
+ puts "#{i} train accuracy #{a}, error #{c}"
57
+
58
+ # success on test data?
59
+ test_data = { x => mnist.test.images, y_ => mnist.test.labels }
60
+ a, c = sess.run([accuracy, cross_entropy], feed_dict: test_data)
61
+ puts " test accuracy #{a}, error #{c}"
62
+ end
63
+ end
64
+
@@ -8,10 +8,9 @@ Project: https://github.com/aymericdamien/TensorFlow-Examples/
8
8
 
9
9
  Make sure to install the mnist-learn gem !!
10
10
  '''
11
-
11
+ require "bundler/setup"
12
12
  require 'tensor_stream'
13
13
  require 'mnist-learn'
14
- require 'tensor_stream/evaluator/opencl/opencl_evaluator'
15
14
 
16
15
  tf = TensorStream
17
16
 
@@ -12,9 +12,9 @@ Project: https://github.com/aymericdamien/TensorFlow-Examples/
12
12
 
13
13
  The mnist-learn gem is required as well as an OpenCL compatible device with drivers correctly installed
14
14
  """
15
+ require "bundler/setup"
15
16
  require 'tensor_stream'
16
17
  require 'mnist-learn'
17
- require 'tensor_stream/evaluator/opencl/opencl_evaluator'
18
18
 
19
19
  tf = TensorStream
20
20
  # Import MNIST data
@@ -44,4 +44,5 @@ Gem::Specification.new do |spec|
44
44
  spec.add_development_dependency "simplecov"
45
45
  spec.add_dependency "deep_merge"
46
46
  spec.add_dependency "concurrent-ruby"
47
+ spec.add_dependency "chunky_png"
47
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tensor_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Emmanuel Dayo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-29 00:00:00.000000000 Z
11
+ date: 2018-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -206,6 +206,20 @@ dependencies:
206
206
  - - ">="
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: chunky_png
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
209
223
  description: A reimplementation of TensorFlow for ruby. This is a ground up implementation
210
224
  with no dependency on TensorFlow. Effort has been made to make the programming style
211
225
  as near to TensorFlow as possible, comes with a pure ruby evaluator by default as
@@ -243,65 +257,14 @@ files:
243
257
  - lib/tensor_stream/evaluator/base_evaluator.rb
244
258
  - lib/tensor_stream/evaluator/buffer.rb
245
259
  - lib/tensor_stream/evaluator/evaluator.rb
246
- - lib/tensor_stream/evaluator/opencl/kernels/_bool_operand.cl
247
- - lib/tensor_stream/evaluator/opencl/kernels/_operand.cl
248
- - lib/tensor_stream/evaluator/opencl/kernels/abs.cl
249
- - lib/tensor_stream/evaluator/opencl/kernels/acos.cl
250
- - lib/tensor_stream/evaluator/opencl/kernels/add.cl
251
- - lib/tensor_stream/evaluator/opencl/kernels/apply_adam.cl
252
- - lib/tensor_stream/evaluator/opencl/kernels/apply_gradient.cl
253
- - lib/tensor_stream/evaluator/opencl/kernels/apply_momentum.cl
254
- - lib/tensor_stream/evaluator/opencl/kernels/argmax.cl
255
- - lib/tensor_stream/evaluator/opencl/kernels/argmin.cl
256
- - lib/tensor_stream/evaluator/opencl/kernels/asin.cl
257
- - lib/tensor_stream/evaluator/opencl/kernels/cast.cl
258
- - lib/tensor_stream/evaluator/opencl/kernels/ceil.cl
259
- - lib/tensor_stream/evaluator/opencl/kernels/cond.cl.erb
260
- - lib/tensor_stream/evaluator/opencl/kernels/cos.cl
261
- - lib/tensor_stream/evaluator/opencl/kernels/div.cl.erb
262
- - lib/tensor_stream/evaluator/opencl/kernels/exp.cl
263
- - lib/tensor_stream/evaluator/opencl/kernels/floor.cl
264
- - lib/tensor_stream/evaluator/opencl/kernels/floor_div.cl
265
- - lib/tensor_stream/evaluator/opencl/kernels/floor_mod.cl
266
- - lib/tensor_stream/evaluator/opencl/kernels/gemm.cl
267
- - lib/tensor_stream/evaluator/opencl/kernels/log.cl
268
- - lib/tensor_stream/evaluator/opencl/kernels/log1p.cl
269
- - lib/tensor_stream/evaluator/opencl/kernels/log_softmax.cl
270
- - lib/tensor_stream/evaluator/opencl/kernels/max.cl
271
- - lib/tensor_stream/evaluator/opencl/kernels/min.cl
272
- - lib/tensor_stream/evaluator/opencl/kernels/mod.cl
273
- - lib/tensor_stream/evaluator/opencl/kernels/mul.cl
274
- - lib/tensor_stream/evaluator/opencl/kernels/negate.cl
275
- - lib/tensor_stream/evaluator/opencl/kernels/pack.cl
276
- - lib/tensor_stream/evaluator/opencl/kernels/pow.cl
277
- - lib/tensor_stream/evaluator/opencl/kernels/real_div.cl
278
- - lib/tensor_stream/evaluator/opencl/kernels/reciprocal.cl
279
- - lib/tensor_stream/evaluator/opencl/kernels/round.cl
280
- - lib/tensor_stream/evaluator/opencl/kernels/sigmoid.cl
281
- - lib/tensor_stream/evaluator/opencl/kernels/sigmoid_grad.cl
282
- - lib/tensor_stream/evaluator/opencl/kernels/sign.cl
283
- - lib/tensor_stream/evaluator/opencl/kernels/sin.cl
284
- - lib/tensor_stream/evaluator/opencl/kernels/softmax.cl
285
- - lib/tensor_stream/evaluator/opencl/kernels/softmax_cross.cl
286
- - lib/tensor_stream/evaluator/opencl/kernels/softmax_cross_grad.cl
287
- - lib/tensor_stream/evaluator/opencl/kernels/softmax_grad.cl
288
- - lib/tensor_stream/evaluator/opencl/kernels/sqrt.cl
289
- - lib/tensor_stream/evaluator/opencl/kernels/square.cl
290
- - lib/tensor_stream/evaluator/opencl/kernels/squared_difference.cl
291
- - lib/tensor_stream/evaluator/opencl/kernels/sub.cl
292
- - lib/tensor_stream/evaluator/opencl/kernels/tan.cl
293
- - lib/tensor_stream/evaluator/opencl/kernels/tanh.cl
294
- - lib/tensor_stream/evaluator/opencl/kernels/tanh_grad.cl
295
- - lib/tensor_stream/evaluator/opencl/kernels/where.cl
296
- - lib/tensor_stream/evaluator/opencl/opencl_buffer.rb
297
- - lib/tensor_stream/evaluator/opencl/opencl_device.rb
298
- - lib/tensor_stream/evaluator/opencl/opencl_evaluator.rb
299
- - lib/tensor_stream/evaluator/opencl/opencl_template_helper.rb
300
260
  - lib/tensor_stream/evaluator/operation_helpers/array_ops_helper.rb
301
261
  - lib/tensor_stream/evaluator/operation_helpers/math_helper.rb
302
262
  - lib/tensor_stream/evaluator/operation_helpers/random_gaussian.rb
263
+ - lib/tensor_stream/evaluator/ruby/array_ops.rb
264
+ - lib/tensor_stream/evaluator/ruby/images_ops.rb
303
265
  - lib/tensor_stream/evaluator/ruby/math_ops.rb
304
266
  - lib/tensor_stream/evaluator/ruby/nn_ops.rb
267
+ - lib/tensor_stream/evaluator/ruby/random_ops.rb
305
268
  - lib/tensor_stream/evaluator/ruby_evaluator.rb
306
269
  - lib/tensor_stream/exceptions.rb
307
270
  - lib/tensor_stream/graph.rb
@@ -313,6 +276,7 @@ files:
313
276
  - lib/tensor_stream/graph_serializers/serializer.rb
314
277
  - lib/tensor_stream/helpers/op_helper.rb
315
278
  - lib/tensor_stream/helpers/string_helper.rb
279
+ - lib/tensor_stream/images.rb
316
280
  - lib/tensor_stream/initializer.rb
317
281
  - lib/tensor_stream/math_gradients.rb
318
282
  - lib/tensor_stream/monkey_patches/integer.rb
@@ -323,6 +287,7 @@ files:
323
287
  - lib/tensor_stream/session.rb
324
288
  - lib/tensor_stream/tensor.rb
325
289
  - lib/tensor_stream/tensor_shape.rb
290
+ - lib/tensor_stream/train/adadelta_optimizer.rb
326
291
  - lib/tensor_stream/train/adam_optimizer.rb
327
292
  - lib/tensor_stream/train/gradient_descent_optimizer.rb
328
293
  - lib/tensor_stream/train/momentum_optimizer.rb
@@ -342,6 +307,7 @@ files:
342
307
  - samples/iris.rb
343
308
  - samples/linear_regression.rb
344
309
  - samples/logistic_regression.rb
310
+ - samples/mnist_data.rb
345
311
  - samples/multigpu.rb
346
312
  - samples/nearest_neighbor.rb
347
313
  - samples/raw_neural_net_sample.rb
@@ -367,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
367
333
  version: '0'
368
334
  requirements: []
369
335
  rubyforge_project:
370
- rubygems_version: 2.7.7
336
+ rubygems_version: 3.0.0.beta1
371
337
  signing_key:
372
338
  specification_version: 4
373
339
  summary: A Pure ruby tensorflow implementation