Files
Reseaux-de-neurones-artific…/app/Services/SynapticWeightsProvider/RandomSynapticWeights.php
Matthias Guillitte ef90236adc
Some checks failed
linter / quality (push) Failing after 6m26s
tests / ci (8.4) (push) Successful in 5m6s
tests / ci (8.5) (push) Successful in 5m38s
Fix linting
2026-03-23 08:44:50 +01:00

17 lines
404 B
PHP

<?php
namespace App\Services\SynapticWeightsProvider;
class RandomSynapticWeights implements ISynapticWeightsProvider
{
public function generate(int $input_size): array
{
$weights = [];
for ($i = 0; $i < $input_size + 1; $i++) { // +1 for bias weight
$weights[] = rand(-100, 100) / 100; // Random weights between -1 and 1
}
return $weights;
}
}