Class: Datasets::MNIST::Record
- Inherits:
-
Struct
- Object
- Struct
- Datasets::MNIST::Record
- Defined in:
- lib/datasets/mnist.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#label ⇒ Object
Returns the value of attribute label.
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
9 10 11 |
# File 'lib/datasets/mnist.rb', line 9 def data @data end |
#label ⇒ Object
Returns the value of attribute label
9 10 11 |
# File 'lib/datasets/mnist.rb', line 9 def label @label end |
Instance Method Details
#pixels ⇒ Object
10 11 12 |
# File 'lib/datasets/mnist.rb', line 10 def pixels data.unpack("C*") end |
#to_h ⇒ Object
14 15 16 17 18 |
# File 'lib/datasets/mnist.rb', line 14 def to_h hash = super hash[:pixels] = pixels hash end |