PHP Classes

File: TEST/TrainingTest/TestNpRand.php

Recommend this page to a friend!
  Classes of Cuthbert Martin Lwinga   PHP Neural Net Library   TEST/TrainingTest/TestNpRand.php   Download  
File: TEST/TrainingTest/TestNpRand.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: 6 months ago
Size: 1,035 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;

$dropout_rate = 0.2;
$n = 1;
$p = 1 - $dropout_rate;

$shape = [3, 3];
$output = NumpyLight::random()->binomial($n, $p, $shape);
print_r($output);
// Load JSON data
// $json_data = file_get_contents('/Users/cuthbertlwinga/Documents/projects/PHP/Neural-Net-PHP/TEST/Neural_Networks_Components/neural_network_data.json');
// echo $_SERVER["DOCUMENT_ROOT"].'/TEST/TrainingTest/neural_network_data.json';
// $json_data = file_get_contents($_SERVER["DOCUMENT_ROOT"].'/TEST/TrainingTest/neural_network_data.json');
// $data = json_decode($json_data, true);

// // Extract spiral_data
// list($X,$y) = $data['spiral_data'];

// $dense1 = new Layer_Dense(2,64);

// // Set weights for dense layer
// $dense1->weights = $data['weights'];
// $dense1->biases = $data['biases'];

// $dense1->forward($X);
// $data['output'];

?>