ruby-dnn 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/.travis.yml +0 -0
  4. data/CODE_OF_CONDUCT.md +0 -0
  5. data/Gemfile +0 -0
  6. data/LICENSE.txt +0 -0
  7. data/README.md +0 -0
  8. data/Rakefile +5 -0
  9. data/examples/api-examples/early_stopping_example.rb +0 -0
  10. data/examples/api-examples/initializer_example.rb +0 -0
  11. data/examples/api-examples/regularizer_example.rb +0 -0
  12. data/examples/api-examples/save_example.rb +0 -0
  13. data/examples/cifar100_example.rb +0 -0
  14. data/examples/cifar10_example.rb +0 -0
  15. data/examples/dcgan/dcgan.rb +0 -0
  16. data/examples/dcgan/imgen.rb +0 -0
  17. data/examples/dcgan/train.rb +0 -0
  18. data/examples/iris_example.rb +0 -0
  19. data/examples/judge-number/README.md +0 -0
  20. data/examples/judge-number/capture.PNG +0 -0
  21. data/examples/judge-number/convnet8.rb +0 -0
  22. data/examples/judge-number/make_weights.rb +0 -0
  23. data/examples/judge-number/mnist_predict.rb +0 -0
  24. data/examples/judge-number/mnist_train.rb +0 -0
  25. data/examples/judge-number/public/httpRequest.js +0 -0
  26. data/examples/judge-number/public/judgeNumber.js +0 -0
  27. data/examples/judge-number/server.rb +0 -0
  28. data/examples/judge-number/trained_mnist_params.marshal +0 -0
  29. data/examples/judge-number/views/index.erb +0 -0
  30. data/examples/mnist_conv2d_example.rb +0 -0
  31. data/examples/mnist_define_by_run.rb +0 -0
  32. data/examples/mnist_example.rb +0 -0
  33. data/examples/mnist_gpu.rb +0 -0
  34. data/examples/mnist_lstm_example.rb +0 -0
  35. data/examples/pix2pix/dcgan.rb +0 -0
  36. data/examples/pix2pix/imgen.rb +0 -0
  37. data/examples/pix2pix/train.rb +0 -0
  38. data/examples/vae.rb +0 -0
  39. data/examples/xor_example.rb +0 -0
  40. data/ext/rb_stb_image/extconf.rb +0 -0
  41. data/ext/rb_stb_image/rb_stb_image.c +0 -0
  42. data/img/cart-pole.gif +0 -0
  43. data/img/cycle-gan.PNG +0 -0
  44. data/img/facade-pix2pix.png +0 -0
  45. data/lib/dnn/core/callbacks.rb +0 -0
  46. data/lib/dnn/core/error.rb +0 -0
  47. data/lib/dnn/core/global.rb +0 -0
  48. data/lib/dnn/core/initializers.rb +0 -0
  49. data/lib/dnn/core/iterator.rb +0 -0
  50. data/lib/dnn/core/layers/activations.rb +0 -0
  51. data/lib/dnn/core/layers/basic_layers.rb +2 -2
  52. data/lib/dnn/core/layers/cnn_layers.rb +0 -0
  53. data/lib/dnn/core/layers/embedding.rb +0 -0
  54. data/lib/dnn/core/layers/math_layers.rb +0 -0
  55. data/lib/dnn/core/layers/merge_layers.rb +2 -2
  56. data/lib/dnn/core/layers/normalizations.rb +0 -0
  57. data/lib/dnn/core/layers/rnn_layers.rb +0 -0
  58. data/lib/dnn/core/layers/split_layers.rb +0 -0
  59. data/lib/dnn/core/link.rb +0 -0
  60. data/lib/dnn/core/losses.rb +2 -2
  61. data/lib/dnn/core/models.rb +0 -0
  62. data/lib/dnn/core/monkey_patch.rb +0 -0
  63. data/lib/dnn/core/optimizers.rb +0 -0
  64. data/lib/dnn/core/param.rb +0 -0
  65. data/lib/dnn/core/regularizers.rb +0 -0
  66. data/lib/dnn/core/savers.rb +0 -0
  67. data/lib/dnn/core/tensor.rb +0 -0
  68. data/lib/dnn/core/utils.rb +0 -0
  69. data/lib/dnn/datasets/cifar10.rb +0 -0
  70. data/lib/dnn/datasets/cifar100.rb +0 -0
  71. data/lib/dnn/datasets/downloader.rb +12 -3
  72. data/lib/dnn/datasets/fashion-mnist.rb +0 -0
  73. data/lib/dnn/datasets/iris.rb +0 -0
  74. data/lib/dnn/datasets/mnist.rb +0 -0
  75. data/lib/dnn/datasets/stl-10.rb +0 -0
  76. data/lib/dnn/image.rb +1 -1
  77. data/lib/dnn/keras-model-convertor.rb +0 -0
  78. data/lib/dnn/numo2numpy.rb +0 -0
  79. data/lib/dnn/version.rb +1 -1
  80. data/lib/dnn.rb +0 -0
  81. data/ruby-dnn.gemspec +1 -0
  82. data/third_party/stb_image.h +0 -0
  83. data/third_party/stb_image_resize.h +0 -0
  84. data/third_party/stb_image_write.h +0 -0
  85. metadata +20 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2aa12b717ef532b8afe44de7cb388c7d87cb271bf38a25adaad2c335c8817d4b
4
- data.tar.gz: e1322f86b06c11ac3728e948e18469ccc6e454eeefb180108a0a9bfc2dbd8143
3
+ metadata.gz: 0155251f4bb07fe6ed61f27102f8ef9b251fcc2cfba72fafaab7819072c28e69
4
+ data.tar.gz: 8fce285715f424cf5d78f38c81b0d653e281cd21ebaa04702e1cd38ce2de6c2b
5
5
  SHA512:
6
- metadata.gz: 6c9c53ca73a5ab7fc53935f37e0804d761e36735aa06972f63e151ce76a44f01878a2c01dfe0622bf39baa5c98b16ee8d06db212356fcc329a9dd40ae2d78f1c
7
- data.tar.gz: 5a195c0afd677127afad2433df2fda3a09c711464c46cb174713d00d695026d2b86faa64f82cc96f2b417b468fc372c04efee22761800c900e2f6b0ca05ac57d
6
+ metadata.gz: b1ec453443c1713323263b0d6b9086eca1978bd6ed9102956cc4ad6098b2698248eedced6851fbf0d2d49223277eff369532e96a53c6df8351b016fdc22830f4
7
+ data.tar.gz: 8f41bf55e995854dfa96159197a40bf1f0e50f5cbf99eee97d835986e4aeef366ddd777ddbbe82514de22a048ca34600107bb59cbc0a2f58c7e3d5f8f1d06dd4
data/.gitignore CHANGED
File without changes
data/.travis.yml CHANGED
File without changes
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
+ require "rake/extensiontask"
3
4
  require "yard"
4
5
  require "yard/rake/yardoc_task"
5
6
 
@@ -10,6 +11,10 @@ Rake::TestTask.new(:test) do |t|
10
11
  t.test_files = FileList["test/*_test.rb", "test/layers_test/*_test.rb"]
11
12
  end
12
13
 
14
+ Rake::ExtensionTask.new "rb_stb_image" do |ext|
15
+ ext.lib_dir = "lib/rb_stb_image"
16
+ end
17
+
13
18
  task :build_rb_stb_image do
14
19
  sh "cd ext/rb_stb_image; ruby extconf.rb; make"
15
20
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/examples/vae.rb CHANGED
File without changes
File without changes
File without changes
File without changes
data/img/cart-pole.gif CHANGED
File without changes
data/img/cycle-gan.PNG CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -26,8 +26,8 @@ module DNN
26
26
  attr_reader :input_shape
27
27
  attr_reader :output_shape
28
28
 
29
- def self.call(x, *args)
30
- new(*args).(x)
29
+ def self.call(x, *args, **kwargs)
30
+ new(*args, **kwargs).(x)
31
31
  end
32
32
 
33
33
  def self.from_hash(hash)
File without changes
File without changes
File without changes
@@ -2,8 +2,8 @@ module DNN
2
2
  module Layers
3
3
 
4
4
  class MergeLayer < Layer
5
- def self.call(x1, x2, *args)
6
- new(*args).call(x1, x2)
5
+ def self.call(x1, x2, *args, **kwargs)
6
+ new(*args, **kwargs).call(x1, x2)
7
7
  end
8
8
 
9
9
  def call(input1, input2)
File without changes
File without changes
File without changes
data/lib/dnn/core/link.rb CHANGED
File without changes
@@ -2,8 +2,8 @@ module DNN
2
2
  module Losses
3
3
 
4
4
  class Loss
5
- def self.call(y, t, *args)
6
- new(*args).(y, t)
5
+ def self.call(y, t, *args, **kwargs)
6
+ new(*args, **kwargs).(y, t)
7
7
  end
8
8
 
9
9
  def self.from_hash(hash)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- require "net/http"
1
+ require "net/https"
2
2
 
3
3
  module DNN
4
4
  DOWNLOADS_PATH = ENV["RUBY_DNN_DOWNLOADS_PATH"] || __dir__
@@ -18,13 +18,22 @@ module DNN
18
18
 
19
19
  def initialize(url)
20
20
  @url = url
21
- *, @fqdn, @path = *url.match(%r`https?://(.+?)(/.+)`)
21
+ *, @protocol, @fqdn, @path = *url.match(%r`(https?)://(.+?)(/.+)`)
22
22
  end
23
23
 
24
24
  def download(dir_path)
25
25
  puts %`download "#{@url}"`
26
26
  buf = ""
27
- Net::HTTP.start(@fqdn) do |http|
27
+ if @protocol == "http"
28
+ port = 80
29
+ elsif @protocol == "https"
30
+ port = 443
31
+ else
32
+ raise "Protocol(#{@protocol}) is not supported."
33
+ end
34
+ http = Net::HTTP.new(@fqdn, port)
35
+ http.use_ssl = true if @protocol == "https"
36
+ http.start do |http|
28
37
  content_length = http.head(@path).content_length
29
38
  http.get(@path) do |body_segment|
30
39
  buf << body_segment
File without changes
File without changes
File without changes
File without changes
data/lib/dnn/image.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require "numo/narray"
2
- require_relative "../../ext/rb_stb_image/rb_stb_image"
2
+ require_relative "../rb_stb_image"
3
3
 
4
4
  module DNN
5
5
  module Image
File without changes
File without changes
data/lib/dnn/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DNN
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
data/lib/dnn.rb CHANGED
File without changes
data/ruby-dnn.gemspec CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
 
18
18
  spec.add_dependency "numo-narray"
19
19
  spec.add_dependency "archive-tar-minitar"
20
+ spec.add_development_dependency "rake-compiler"
20
21
 
21
22
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
23
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-dnn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - unagiootoro
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-28 00:00:00.000000000 Z
11
+ date: 2023-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-narray
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake-compiler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -195,7 +209,7 @@ homepage: https://github.com/unagiootoro/ruby-dnn.git
195
209
  licenses:
196
210
  - MIT
197
211
  metadata: {}
198
- post_install_message:
212
+ post_install_message:
199
213
  rdoc_options: []
200
214
  require_paths:
201
215
  - lib
@@ -210,8 +224,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
224
  - !ruby/object:Gem::Version
211
225
  version: '0'
212
226
  requirements: []
213
- rubygems_version: 3.0.3
214
- signing_key:
227
+ rubygems_version: 3.2.33
228
+ signing_key:
215
229
  specification_version: 4
216
230
  summary: ruby deep learning library.
217
231
  test_files: []