tensor_stream 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4059c6bb82fc83c5aee32090e9c58231f9fd421afb3aa8bea1cbff4857edeb18
4
- data.tar.gz: b7ceee8509455146402c3b3cdf9fa0a63eeec3dfee5512dd6e097221f1247481
3
+ metadata.gz: 1f312e783bb684267b34aa4a12cfcea525095f0fa7237c4666c19e04e21b669c
4
+ data.tar.gz: 8910619b66cff18f07dd6c4c0ff0a68273f4534e702ef2ace26dfb99de162850
5
5
  SHA512:
6
- metadata.gz: 329eb6875b1add417656537beac95d67c1c061fa3eba3b04031d3ac6f1a20f7e26bf12e66873b70ad575fe7d9f0482c02888f0b544405ba9d73d5b325070966f
7
- data.tar.gz: 639a4d90dc1525e063bcdac3b30805a38697b009634d17cb745c99189b88b10b95ce49a9136d5c9c0617fbf3ca3ee1a74429a8579437b7896954ff6529952e79
6
+ metadata.gz: 6586f8f501505322fe94da573d38923fac7546c72b9a96df4bac22e9c2ec3bb2b60fa1682fb8ed330a58d068a6917e829a9f69ab6a8be4f8a2b6d3e46d7891f6
7
+ data.tar.gz: 8fbf3fb157c6c30240a5bc9d578341c38d562f7e2b6510640e4d1e568770954275a6f21c0c53e310cd665c8773ed7432c0a16338bf806cd4e6cdcbdea48a61a1
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.9.6] - 2018-11-18
8
+ - [NEW OP] Convolutional networks - conv2d, conv2d_backprop_filter, conv2d_backprop_input
9
+ - [IMAGE] Exposed image resampling options
10
+ - [BUG FIX] fix argmin, argmax handling of NaN values
11
+
7
12
  ## [0.9.5] - 2018-11-05
8
13
  - [NEW OP] assert_equal, relu6
9
14
  - [TRAINING] learning_rate_decay, dropout
@@ -264,6 +264,8 @@ module TensorStream
264
264
 
265
265
  (0...height).step(height_stride).each do |y|
266
266
  (0...width).step(width_stride).each do |x|
267
+ img_grad = grad[b][y/height_stride][x/width_stride]
268
+
267
269
  (0...f_height).each do |f_y|
268
270
  (0...f_width).each do |f_x|
269
271
  next if x + f_x >= width
@@ -271,7 +273,7 @@ module TensorStream
271
273
 
272
274
  channels.times.each do |c|
273
275
  image_gradient[y + f_y][x + f_x][c] += Array.new(output_channels) do |o_c|
274
- filter[f_y][f_x][c][o_c] * grad[b][(y/height_stride) + f_y][(x/width_stride) + f_x][o_c]
276
+ filter[f_y][f_x][c][o_c] * img_grad[o_c]
275
277
  end.reduce(:+)
276
278
  end
277
279
  end
@@ -298,15 +300,15 @@ module TensorStream
298
300
 
299
301
  (0...height).step(height_stride).each do |y|
300
302
  (0...width).step(width_stride).each do |x|
303
+ image_grad = grad[index][y/height_stride][x/width_stride]
301
304
  filter_result = (0...f_height).map do |f_y|
302
305
  (0...f_width).map do |f_x|
303
-
304
306
  next Array.new(input_channels * output_channels) { 0.0 } if x + f_x >= width
305
307
  next Array.new(input_channels * output_channels) { 0.0 } if y + f_y >= height
306
308
 
307
309
  image[y + f_y][x + f_x].each_with_index.map do |image_channel, c_channel|
308
310
  output_channels.times.map do |o_c|
309
- image_channel * grad[index][(y/height_stride) + f_y][(x/width_stride) + f_x][o_c]
311
+ image_channel * image_grad[o_c]
310
312
  end
311
313
  end
312
314
  end
@@ -178,6 +178,10 @@ module TensorStream
178
178
  new_shape = tensor.inputs[0].shape.shape.dup
179
179
  new_shape[3] = tensor.inputs[1].shape.shape[3]
180
180
  new_shape
181
+ when :conv2d_backprop_input
182
+ return nil unless tensor.inputs[0].value
183
+
184
+ tensor.inputs[0].value
181
185
  else
182
186
  return nil if tensor.inputs[0].nil?
183
187
  return tensor.inputs[0].shape.shape if tensor.inputs.size == 1
@@ -66,6 +66,8 @@ module TensorStream
66
66
  passed_data_type || :float32
67
67
  when :concat
68
68
  @inputs[1].data_type
69
+ when :conv2d_backprop_input
70
+ @inputs[1].data_type
69
71
  when :index
70
72
  if @inputs[0].is_a?(ControlFlow)
71
73
 
@@ -1,5 +1,5 @@
1
1
  module TensorStream
2
- VERSION = '0.9.6'.freeze
2
+ VERSION = '0.9.7'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
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.9.6
4
+ version: 0.9.7
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-11-18 00:00:00.000000000 Z
11
+ date: 2018-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler