ruby-dnn 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +2 -1
  4. data/CODE_OF_CONDUCT.md +0 -0
  5. data/Gemfile +0 -0
  6. data/LICENSE.txt +0 -0
  7. data/README.md +32 -19
  8. data/Rakefile +0 -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 +1 -1
  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.rb +0 -0
  46. data/lib/dnn/core/callbacks.rb +0 -0
  47. data/lib/dnn/core/error.rb +0 -0
  48. data/lib/dnn/core/global.rb +0 -0
  49. data/lib/dnn/core/initializers.rb +0 -0
  50. data/lib/dnn/core/iterator.rb +0 -0
  51. data/lib/dnn/core/layers/activations.rb +0 -0
  52. data/lib/dnn/core/layers/basic_layers.rb +0 -0
  53. data/lib/dnn/core/layers/cnn_layers.rb +0 -0
  54. data/lib/dnn/core/layers/embedding.rb +0 -0
  55. data/lib/dnn/core/layers/math_layers.rb +0 -0
  56. data/lib/dnn/core/layers/merge_layers.rb +0 -0
  57. data/lib/dnn/core/layers/normalizations.rb +0 -0
  58. data/lib/dnn/core/layers/rnn_layers.rb +0 -0
  59. data/lib/dnn/core/layers/split_layers.rb +0 -0
  60. data/lib/dnn/core/link.rb +0 -0
  61. data/lib/dnn/core/losses.rb +0 -0
  62. data/lib/dnn/core/models.rb +0 -0
  63. data/lib/dnn/core/monkey_patch.rb +0 -0
  64. data/lib/dnn/core/optimizers.rb +0 -0
  65. data/lib/dnn/core/param.rb +0 -0
  66. data/lib/dnn/core/regularizers.rb +0 -0
  67. data/lib/dnn/core/savers.rb +0 -0
  68. data/lib/dnn/core/tensor.rb +0 -0
  69. data/lib/dnn/core/utils.rb +0 -0
  70. data/lib/dnn/datasets/cifar10.rb +0 -0
  71. data/lib/dnn/datasets/cifar100.rb +0 -0
  72. data/lib/dnn/datasets/downloader.rb +0 -0
  73. data/lib/dnn/datasets/fashion-mnist.rb +0 -0
  74. data/lib/dnn/datasets/iris.rb +0 -0
  75. data/lib/dnn/datasets/mnist.rb +0 -0
  76. data/lib/dnn/datasets/stl-10.rb +0 -0
  77. data/lib/dnn/image.rb +0 -0
  78. data/lib/dnn/keras-model-convertor.rb +0 -0
  79. data/lib/dnn/numo2numpy.rb +0 -0
  80. data/lib/dnn/version.rb +1 -1
  81. data/ruby-dnn.gemspec +2 -15
  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 +27 -20
  86. data/bin/console +0 -14
  87. data/bin/setup +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8475052a51f8b81f176c8b3a77c953d116fb1098b7f24fe8a2ad9135b2f2a33b
4
- data.tar.gz: f291c99be16b9a35fee59a09cefda3b9aece1bbaef5d6b482fad6d238043e68b
3
+ metadata.gz: 2aa12b717ef532b8afe44de7cb388c7d87cb271bf38a25adaad2c335c8817d4b
4
+ data.tar.gz: e1322f86b06c11ac3728e948e18469ccc6e454eeefb180108a0a9bfc2dbd8143
5
5
  SHA512:
6
- metadata.gz: '08f061510f73297b12b53cd3da5748dd47e67605d1b40c35388779a94e023e37450d2c9ebd9ec1bf0970c1580c7481f46c6cef05d54af5748fe175522b198c5e'
7
- data.tar.gz: fdfe99ac9b5a63e4914aaab4f71a37e56b097c6b00560245a82438c6fd70ab658683de95c1ddef0283f4cc2f0b9e261dda798158cd374cf19cc17966ed338b16
6
+ metadata.gz: 6c9c53ca73a5ab7fc53935f37e0804d761e36735aa06972f63e151ce76a44f01878a2c01dfe0622bf39baa5c98b16ee8d06db212356fcc329a9dd40ae2d78f1c
7
+ data.tar.gz: 5a195c0afd677127afad2433df2fda3a09c711464c46cb174713d00d695026d2b86faa64f82cc96f2b417b468fc372c04efee22761800c900e2f6b0ca05ac57d
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ *.lock
@@ -1,6 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.6.1
4
+ - 2.6
5
+ - 2.7
5
6
  script:
6
7
  - rake test
File without changes
data/Gemfile CHANGED
File without changes
File without changes
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # ruby-dnn
2
- [![Gem Version](https://badge.fury.io/rb/ruby-dnn.svg)](https://badge.fury.io/rb/ruby-dnn)
2
+ [![Gem Version](https://badge.fury.io/rb/ruby-dnn.svg)](https://badge.fury.io/rb/ruby-dnn)
3
3
  [![Build Status](https://travis-ci.org/unagiootoro/ruby-dnn.svg?branch=master)](https://travis-ci.org/unagiootoro/ruby-dnn)
4
+ [![Docs Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://rubydoc.info/gems/ruby-dnn)
4
5
 
5
6
  ruby-dnn is a ruby deep learning library. This library supports full connected neural network and convolution neural network
6
7
  and recurrent neural network.
@@ -84,6 +85,23 @@ puts "loss: #{loss}"
84
85
  Please refer to examples for basic usage.
85
86
  If you want to know more detailed information, please refer to the source code.
86
87
 
88
+ ## Sample
89
+
90
+ * Pix2pix
91
+ Convert an abstract image into a building image.
92
+ [https://github.com/unagiootoro/facade-pix2pix](https://github.com/unagiootoro/facade-pix2pix)
93
+ ![facade-pix2pix.png](img/facade-pix2pix.png)
94
+
95
+ * Cycle-GAN
96
+ Convert apples to oranges and oranges to apples.
97
+ [https://github.com/unagiootoro/apple2orange-cyclegan](https://github.com/unagiootoro/apple2orange-cyclegan)
98
+ ![cycle-gan.PNG](img/cycle-gan.PNG)
99
+
100
+ * DQN
101
+ Learn the game so that the pole on the cart does not fall.
102
+ [https://github.com/unagiootoro/ruby-rl](https://github.com/unagiootoro/ruby-rl)
103
+ ![cart-pole.gif](img/cart-pole.gif)
104
+
87
105
  ## Implemented
88
106
  || Implemented classes |
89
107
  |:-----------|------------:|
@@ -95,32 +113,27 @@ If you want to know more detailed information, please refer to the source code.
95
113
  | Losses | MeanSquaredError, MeanAbsoluteError, Hinge, HuberLoss, SoftmaxCrossEntropy, SigmoidCrossEntropy |
96
114
 
97
115
  ## Datasets
98
- By setting the environment variable 'RUBY_DNN_DOWNLOADS_PATH', you can specify the path to read dataset.
99
-
100
- ● Iris
101
- ● MNIST
102
- ● Fashion-MNIST
103
- ● CIFAR-10
104
- ● CIFAR-100
105
- ● STL-10
116
+ By setting the environment variable `RUBY_DNN_DOWNLOADS_PATH`, you can specify the path to read dataset.
106
117
 
107
- ## Examples
108
- VAE
109
- DCGAN
110
- Pix2pix
118
+ * Iris
119
+ * MNIST
120
+ * Fashion-MNIST
121
+ * CIFAR-10
122
+ * CIFAR-100
123
+ * STL-10
111
124
 
112
125
  ## Use GPU
113
- If you do 'require "cumo/narray"' before 'require "dnn"', you can run it on GPU.
114
- Or, set the environment variable 'RUBY_DNN_USE_CUMO 'to'ENABLE' to force the GPU to be used.
126
+ If you do `require "cumo/narray"` before `require "dnn"`, you can run it on GPU.
127
+ Or, set the environment variable `RUBY_DNN_USE_CUMO` to `ENABLE` to force the GPU to be used.
115
128
 
116
129
  ## TODO
117
- Write a test.
118
- Write a document.
119
- Improve performance when using GPU.
130
+ * Write a test.
131
+ * Write a document.
132
+ * Improve performance when using GPU.
120
133
 
121
134
  ## Development
122
135
 
123
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake "spec"` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
136
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake "test"` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
124
137
 
125
138
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
126
139
 
data/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -129,7 +129,7 @@ class DCGAN < Model
129
129
  y_fake = Numo::SFloat.zeros(batch_size, 1)
130
130
  @dis.enable_training
131
131
  dis_loss = @dis.train_on_batch(x_batch, y_real)
132
- dis_loss + @dis.train_on_batch(images, y_fake)
132
+ dis_loss += @dis.train_on_batch(images, y_fake)
133
133
 
134
134
  noise = Numo::SFloat.new(batch_size, 20).rand(-1, 1)
135
135
  label = Numo::SFloat.cast([1] * batch_size).reshape(batch_size, 1)
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
Binary file
Binary file
Binary file
data/lib/dnn.rb 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
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
@@ -1,3 +1,3 @@
1
1
  module DNN
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -17,21 +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_dependency "yard"
21
20
 
22
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
23
- # to allow pushing to a single host or delete this section to allow pushing to any host.7
24
- =begin
25
- if spec.respond_to?(:metadata)
26
- spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
27
- else
28
- raise "RubyGems 2.0 or newer is required to protect against " \
29
- "public gem pushes."
30
- end
31
- =end
32
-
33
- # Specify which files should be added to the gem when it is released.
34
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
35
21
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
36
22
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
37
23
  end
@@ -39,7 +25,8 @@ Gem::Specification.new do |spec|
39
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
40
26
  spec.require_paths = ["lib"]
41
27
 
42
- spec.add_development_dependency "bundler", "~> 1.16"
28
+ spec.add_development_dependency "bundler", ">= 1.16", "<3.0"
43
29
  spec.add_development_dependency "rake", ">= 12.3.3"
44
30
  spec.add_development_dependency "minitest", "~> 5.0"
31
+ spec.add_development_dependency "yard"
45
32
  end
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.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - unagiootoro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-24 00:00:00.000000000 Z
11
+ date: 2020-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-narray
@@ -38,34 +38,26 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: yard
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: bundler
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - "~>"
45
+ - - ">="
60
46
  - !ruby/object:Gem::Version
61
47
  version: '1.16'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '3.0'
62
51
  type: :development
63
52
  prerelease: false
64
53
  version_requirements: !ruby/object:Gem::Requirement
65
54
  requirements:
66
- - - "~>"
55
+ - - ">="
67
56
  - !ruby/object:Gem::Version
68
57
  version: '1.16'
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.0'
69
61
  - !ruby/object:Gem::Dependency
70
62
  name: rake
71
63
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +86,20 @@ dependencies:
94
86
  - - "~>"
95
87
  - !ruby/object:Gem::Version
96
88
  version: '5.0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: yard
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
97
103
  description: ruby-dnn is a ruby deep learning library.
98
104
  email:
99
105
  - ootoro838861@outlook.jp
@@ -109,8 +115,6 @@ files:
109
115
  - LICENSE.txt
110
116
  - README.md
111
117
  - Rakefile
112
- - bin/console
113
- - bin/setup
114
118
  - examples/api-examples/early_stopping_example.rb
115
119
  - examples/api-examples/initializer_example.rb
116
120
  - examples/api-examples/regularizer_example.rb
@@ -144,6 +148,9 @@ files:
144
148
  - examples/xor_example.rb
145
149
  - ext/rb_stb_image/extconf.rb
146
150
  - ext/rb_stb_image/rb_stb_image.c
151
+ - img/cart-pole.gif
152
+ - img/cycle-gan.PNG
153
+ - img/facade-pix2pix.png
147
154
  - lib/dnn.rb
148
155
  - lib/dnn/core/callbacks.rb
149
156
  - lib/dnn/core/error.rb
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "dnn"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here