mnist-learn 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 +4 -4
- data/.gitignore +1 -0
- data/.rspec_status +2 -2
- data/lib/mnist-learn/version.rb +1 -1
- data/lib/mnist-learn.rb +7 -7
- data/mnist-learn-0.1.0.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 504c344a2c988dabc88a999e39ddf1606d933104
|
4
|
+
data.tar.gz: 0f14af637ecba647edd55029b2ed31f3736f8ad4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a46c24443968425589a876d8057a8343ecd42c5afcf417e732006927c2ea3578fad1823be83a7913550b2c420a20e8f395c9e3dea781d58dcdab0dfd677f5cfe
|
7
|
+
data.tar.gz: 7761897fa21b0c0503adf09a385563bb4951087cb60d843ecc1549f1309f22c6d0ba85749e05d710b42dc48f71a54ebc3eb9f1f90b21bd81705fe76e783be670
|
data/.gitignore
CHANGED
data/.rspec_status
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
--------------------------- | ------ | ------------ |
|
3
|
-
./spec/mnist_spec.rb[1:1:1] | passed | 6.
|
4
|
-
./spec/mnist_spec.rb[1:1:2] |
|
3
|
+
./spec/mnist_spec.rb[1:1:1] | passed | 6.49 seconds |
|
4
|
+
./spec/mnist_spec.rb[1:1:2] | passed | 3.01 seconds |
|
data/lib/mnist-learn/version.rb
CHANGED
data/lib/mnist-learn.rb
CHANGED
@@ -66,7 +66,7 @@ module Mnist
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def labels
|
69
|
-
@all_labels ||= load_labels
|
69
|
+
@all_labels ||= (@one_hot ? load_labels.map { |label_data| one_hot_transform(label_data) } : load_labels)
|
70
70
|
end
|
71
71
|
|
72
72
|
def next_batch(batch_size)
|
@@ -78,12 +78,12 @@ module Mnist
|
|
78
78
|
labels = []
|
79
79
|
batch_size.times.each do
|
80
80
|
next if @index >= @total_count
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
81
|
+
image_data = @images[@index]
|
82
|
+
label_data = @labels[@index]
|
83
|
+
image_data.map! { |b| b.to_f / 255.0 }
|
84
|
+
@index += 1
|
85
|
+
images << image_data
|
86
|
+
labels << (@one_hot ? one_hot_transform(label_data) : label_data.to_f)
|
87
87
|
end
|
88
88
|
[images, labels]
|
89
89
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mnist-learn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Dayo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- exe/mnist2csv
|
99
99
|
- lib/mnist-learn.rb
|
100
100
|
- lib/mnist-learn/version.rb
|
101
|
+
- mnist-learn-0.1.0.gem
|
101
102
|
- mnist-learn.gemspec
|
102
103
|
- script/console
|
103
104
|
- script/setup
|