Cifar10

  • namespace: Rindow\NeuralNetworks\Dataset
  • classname: Cifar10

CIFAR-10 images sample dataset. See CIFAR-10 web site.

Methods

constructor

$builer->cifar10()
return $dataset

You can create a CIFAR-10 dataset instances with the Dataset Builder.

loadData

public function loadData(string $filePath=null)
return [[$train_images, $train_labels],
        [$test_images,  $test_labels ]];

Load dataset from the CIFAR-10 public site. And translate to NDArray. Downloaded data is cached.

Arguments:

  • filePath: path where to cache the dataset locally.
    • Default path is sys_get_temp_dir().’/rindow/nn/datasets/cifar-10-batches-bin’

Examples

$cifar10 = $nn->datasets()->cifar10();
[[$train_images, $train_labels],
 [$test_images,  $test_labels ]] = $cifar10->loadData(__DIR__.'/../data/cifar10');