????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.191 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/var/www/appsrv.astacus.se/ai/ |
Upload File : |
<?php
/** node class
*
*
*
* @author Rafael Martin Soto
* @author {@link http://www.inatica.com/ Inatica}
* @since July 2021
* @version 1.0.1
* @license GNU General Public License v3.0
*
* @param array $arr_weights_to_next_layer
*/
class node
{
public $arr_weights_to_next_layer = array();
public $bias = .5;
public $delta = null; // Used for nodes of last layer in BackPropagation function
public function __construct( $arr_weights_to_next_layer = [.5], $default_bias = .5) {
$this->arr_weights_to_next_layer = $arr_weights_to_next_layer;
$this->bias = $default_bias;
} // /__construct()
/**
* Init the weights from this node to each node of the next layer
*
* @param array array of weights
*/
public function setNodeWeightsToNextLayer( $arrNewWeights = [.5] ) {
$this->arr_weights_to_next_layer = $arrNewWeights;
} // /setNodeWeightsToNextLayer()
/**
* Export the data of node into jSON object
*
* @return json $arrJSON
*/
public function exportData2Json(){
$arrJSON = [ 'Node' =>
[ 'arr_weights_to_next_layer' => $this->arr_weights_to_next_layer,
'bias' => $this->bias,
]
];
return json_encode($arrJSON);
} // /exportData2Json()
/**
* Import the data of jSON object into node
*
* @param json $JsonData
*/
public function importJson2Data($JsonData){
$JsonDataNode = $JsonData->Node;
$this->arr_weights_to_next_layer = $JsonDataNode->arr_weights_to_next_layer;
$this->bias = $JsonDataNode->bias;
} // /importJson2Data()
}
?>