PHP Classes

File: TEST/TrainingTest/JacobianTest.php

Recommend this page to a friend!
  Classes of Cuthbert Martin Lwinga   PHP Neural Net Library   TEST/TrainingTest/JacobianTest.php   Download  
File: TEST/TrainingTest/JacobianTest.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Neural Net Library
Build, train, evaluate, and use neural networks
Author: By
Last change:
Date: 4 months ago
Size: 870 bytes
 

Contents

Class file image Download
<?php
include_once("../../CLASSES/Headers.php");
use
NameSpaceNumpyLight\NumpyLight;
use
NameSpaceRandomGenerator\RandomGenerator;
use
NameSpaceActivationRelu\Activation_Relu;
use
NameSpaceOptimizerSGD\Optimizer_SGD;


// Sample inputs and dvalues for testing
$sample_inputs = [
    [
2.0, 3.0, 4.0],
    [
1.0, -1.0, 0.5],
        [
2.0, 3.0, 4.0],
    [
1.0, -1.0, 0.5]
];
$sample_dvalues = [
    [
0.1, 0.5, -0.6],
    [-
0.1, 0.2, -0.1],
        [
2.0, 3.0, 4.0],
    [
1.0, -1.0, 0.5]
];

// Test the Activation_Softmax class
$activation_softmax = new Activation_Softmax();
$activation_softmax->forward($sample_inputs);
$forward_output = $activation_softmax->output;
$activation_softmax->backward($sample_dvalues);
$backward_output = $activation_softmax->dinputs;

NumpyLight::displayMatrix($forward_output);
echo
"\n\n\n\n";
NumpyLight::displayMatrix($backward_output);
?>