rumale-torch 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ec07a29a0bfa24f06e95a9cd8ca4e80eb61ffcb80d66caa2fc29b9f288bbb70
4
- data.tar.gz: 4831243f51051c809c73d090424341fffec4b194f9f6e8fb83e648ab5ba4619e
3
+ metadata.gz: 32ee2cbc5870b7921c3e6e1aeb9c9bdc045633c71c643d1f8c40f9208b5394cb
4
+ data.tar.gz: 0d6d06dc1a320304a5ba69bd54d70cb5983f557df83177df03727aae95e5dd3d
5
5
  SHA512:
6
- metadata.gz: 053ed2b73a9edb5bb44631ed815555ca9bea25dab6de0edaa88bbd3358de07ea488d9c830ed083a99cb62007691512beb8cf68b0380fa440ecdfd22d5c1457c6
7
- data.tar.gz: 1c483667b49e6bab0d2bd9cf8665b1f5d1f2e7a58f3e70b01800f50dc89d98b3cedd03ad30cb59c441c4c8bb355d63556863bb238081e304e20dfc15cd2d478c
6
+ metadata.gz: ce42427042ccea12d20c145bee5ebc4b1a1f56e307b8cdbb4aa6b560b36208b178086a1dbf2f5818dc69ce17c6b57bf97db1d95c21d8ab3d0d8a0e55f6d43a4f
7
+ data.tar.gz: 6d5841581a59a7c8cf57be45afdd0c174bcb938c1a85400d8fe35c1d315837fbdadf12b71155f72d7bfcb8e01ffdccc184fe78ff897ab4b6d78b660c199767f8
data/CHANGELOG.md CHANGED
@@ -1,2 +1,6 @@
1
+ # 0.1.1
2
+ - Refator codes and config files.
3
+ - Introduce commitlint and rubocop.
4
+
1
5
  # 0.1.0
2
6
  - First release.
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2020 Atsushi Tatsuma
1
+ Copyright (c) 2020-2022 Atsushi Tatsuma
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # Rumale::Torch
2
2
 
3
3
  [![Build Status](https://github.com/yoshoku/rumale-torch/workflows/build/badge.svg)](https://github.com/yoshoku/rumale-torch/actions?query=workflow%3Abuild)
4
+ [![Coverage Status](https://coveralls.io/repos/github/yoshoku/rumale-torch/badge.svg?branch=main)](https://coveralls.io/github/yoshoku/rumale-torch?branch=main)
4
5
  [![Gem Version](https://badge.fury.io/rb/rumale-torch.svg)](https://badge.fury.io/rb/rumale-torch)
5
6
  [![BSD 3-Clause License](https://img.shields.io/badge/License-BSD%203--Clause-orange.svg)](https://github.com/yoshoku/rumale-torch/blob/main/LICENSE.txt)
6
- [![Documentation](http://img.shields.io/badge/api-reference-blue.svg)](https://yoshoku.github.io/rumale-torch/doc/)
7
+ [![Documentation](https://img.shields.io/badge/api-reference-blue.svg)](https://yoshoku.github.io/rumale-torch/doc/)
7
8
 
8
9
  Rumale::Torch provides the learning and inference by the neural network defined in [torch.rb](https://github.com/ankane/torch.rb)
9
10
  with the same interface as [Rumale](https://github.com/yoshoku/rumale).
@@ -211,12 +212,10 @@ $ ruby cv.rb
211
212
 
212
213
  ## Contributing
213
214
 
214
- Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/rumale-torch. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/yoshoku/rumale-torch/blob/master/CODE_OF_CONDUCT.md).
215
+ Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/rumale-torch.
216
+ This project is intended to be a safe, welcoming space for collaboration,
217
+ and contributors are expected to adhere to the [Contributor Covenant](https://contributor-covenant.org) code of conduct.
215
218
 
216
219
  ## License
217
220
 
218
221
  The gem is available as open source under the terms of the [BSD-3-Clause License](https://opensource.org/licenses/BSD-3-Clause).
219
-
220
- ## Code of Conduct
221
-
222
- Everyone interacting in the Rumale::Torch project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yoshoku/rumale-torch/blob/master/CODE_OF_CONDUCT.md).
@@ -193,9 +193,13 @@ module Rumale
193
193
 
194
194
  def display_epoch(train_loader, test_loader, epoch)
195
195
  if test_loader.nil?
196
- puts(format("epoch: %#{max_epoch.to_s.length}d/#{max_epoch} - loss: %.4f - accuracy: %.4f", epoch, *evaluate(train_loader)))
196
+ puts(format("epoch: %#{max_epoch.to_s.length}d/#{max_epoch} - loss: %.4f - accuracy: %.4f",
197
+ epoch, *evaluate(train_loader)))
197
198
  else
198
- puts(format("epoch: %#{max_epoch.to_s.length}d/#{max_epoch} - loss: %.4f - accuracy: %.4f - val_loss: %.4f - val_accuracy: %.4f", epoch, *evaluate(train_loader), *evaluate(test_loader)))
199
+ # rubocop:disable Layout/LineLength
200
+ puts(format("epoch: %#{max_epoch.to_s.length}d/#{max_epoch} - loss: %.4f - accuracy: %.4f - val_loss: %.4f - val_accuracy: %.4f",
201
+ epoch, *evaluate(train_loader), *evaluate(test_loader)))
202
+ # rubocop:enable Layout/LineLength
199
203
  end
200
204
  end
201
205
 
@@ -182,7 +182,8 @@ module Rumale
182
182
  if test_loader.nil?
183
183
  puts(format("epoch: %#{max_epoch.to_s.length}d/#{max_epoch} - loss: %.4f", epoch, evaluate(train_loader)))
184
184
  else
185
- puts(format("epoch: %#{max_epoch.to_s.length}d/#{max_epoch} - loss: %.4f - val_loss: %.4f", epoch, evaluate(train_loader), evaluate(test_loader)))
185
+ puts(format("epoch: %#{max_epoch.to_s.length}d/#{max_epoch} - loss: %.4f - val_loss: %.4f",
186
+ epoch, evaluate(train_loader), evaluate(test_loader)))
186
187
  end
187
188
  end
188
189
 
@@ -6,6 +6,6 @@ module Rumale
6
6
  # the neural nets defined in torch.rb with the same interface as Rumale.
7
7
  module Torch
8
8
  # The version of Rumale::Torch you are using.
9
- VERSION = '0.1.0'
9
+ VERSION = '0.1.1'
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumale-torch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-29 00:00:00.000000000 Z
11
+ date: 2022-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rumale
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '0.14'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '0.24'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - ">="
27
+ - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: '0'
29
+ version: '0.14'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.24'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: torch-rb
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -38,28 +44,23 @@ dependencies:
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
46
  version: '0'
41
- description: Rumale::Torch provides the learning and inference by the neural network
47
+ description: 'Rumale::Torch provides the learning and inference by the neural network
42
48
  defined in torch.rb with the same interface as Rumale
49
+
50
+ '
43
51
  email:
44
52
  - yoshoku@outlook.com
45
53
  executables: []
46
54
  extensions: []
47
55
  extra_rdoc_files: []
48
56
  files:
49
- - ".github/workflows/build.yml"
50
- - ".gitignore"
51
- - ".rspec"
52
57
  - CHANGELOG.md
53
- - CODE_OF_CONDUCT.md
54
- - Gemfile
55
58
  - LICENSE.txt
56
59
  - README.md
57
- - Rakefile
58
60
  - lib/rumale/torch.rb
59
61
  - lib/rumale/torch/neural_net_classifier.rb
60
62
  - lib/rumale/torch/neural_net_regressor.rb
61
63
  - lib/rumale/torch/version.rb
62
- - rumale-torch.gemspec
63
64
  homepage: https://github.com/yoshoku/rumale-torch
64
65
  licenses:
65
66
  - BSD-3-Clause
@@ -68,7 +69,8 @@ metadata:
68
69
  source_code_uri: https://github.com/yoshoku/rumale-torch
69
70
  changelog_uri: https://github.com/yoshoku/rumale-torch/blob/main/CHANGELOG.md
70
71
  documentation_uri: https://yoshoku.github.io/rumale-torch/doc/
71
- post_install_message:
72
+ rubygems_mfa_required: 'true'
73
+ post_install_message:
72
74
  rdoc_options: []
73
75
  require_paths:
74
76
  - lib
@@ -83,8 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
85
  - !ruby/object:Gem::Version
84
86
  version: '0'
85
87
  requirements: []
86
- rubygems_version: 3.1.4
87
- signing_key:
88
+ rubygems_version: 3.2.33
89
+ signing_key:
88
90
  specification_version: 4
89
91
  summary: Rumale::Torch provides the learning and inference by the neural network defined
90
92
  in torch.rb with the same interface as Rumale
@@ -1,33 +0,0 @@
1
- name: build
2
- on: [push, pull_request]
3
- jobs:
4
- build:
5
- runs-on: ubuntu-20.04
6
- strategy:
7
- matrix:
8
- ruby: [ '2.5', '2.6', '2.7' ]
9
- env:
10
- LIBTORCH_VERSION: 1.7.1
11
- steps:
12
- - uses: actions/checkout@v2
13
- - name: Set up Ruby ${{ matrix.ruby }}
14
- uses: actions/setup-ruby@v1
15
- with:
16
- ruby-version: ${{ matrix.ruby }}
17
- - uses: actions/cache@v2
18
- with:
19
- path: ~/libtorch
20
- key: libtorch-${{ env.LIBTORCH_VERSION }}
21
- id: cache-libtorch
22
- - name: Download LibTorch
23
- if: steps.cache-libtorch.outputs.cache-hit != 'true'
24
- run: |
25
- cd ~
26
- wget -q -O libtorch.zip https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-$LIBTORCH_VERSION%2Bcpu.zip
27
- unzip -q libtorch.zip
28
- - name: Build and test with Rake
29
- run: |
30
- gem install bundler
31
- bundle config build.torch-rb --with-torch-dir=$HOME/libtorch
32
- bundle install
33
- bundle exec rake
data/.gitignore DELETED
@@ -1,18 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
12
-
13
- .DS_Store
14
- .ruby-version
15
- tags
16
- Gemfile.lock
17
- *.swp
18
- *.bundle
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at yoshoku@outlook.com. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in rumale-torch.gemspec
6
- gemspec
7
-
8
- gem 'rake', '~> 13.0'
9
- gem 'rspec', '~> 3.0'
10
- gem 'simplecov', '~> 0.19'
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec
data/rumale-torch.gemspec DELETED
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/rumale/torch/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'rumale-torch'
7
- spec.version = Rumale::Torch::VERSION
8
- spec.authors = ['yoshoku']
9
- spec.email = ['yoshoku@outlook.com']
10
-
11
- spec.summary = 'Rumale::Torch provides the learning and inference by the neural network defined in torch.rb with the same interface as Rumale'
12
- spec.description = 'Rumale::Torch provides the learning and inference by the neural network defined in torch.rb with the same interface as Rumale'
13
- spec.homepage = 'https://github.com/yoshoku/rumale-torch'
14
- spec.license = 'BSD-3-Clause'
15
-
16
- spec.metadata['homepage_uri'] = spec.homepage
17
- spec.metadata['source_code_uri'] = spec.homepage
18
- spec.metadata['changelog_uri'] = 'https://github.com/yoshoku/rumale-torch/blob/main/CHANGELOG.md'
19
- spec.metadata['documentation_uri'] = 'https://yoshoku.github.io/rumale-torch/doc/'
20
-
21
- # Specify which files should be added to the gem when it is released.
22
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
25
- end
26
- spec.bindir = 'exe'
27
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
- spec.require_paths = ['lib']
29
-
30
- spec.add_runtime_dependency 'rumale'
31
- spec.add_runtime_dependency 'torch-rb'
32
- end