예제 #1
0
파일: index.php 프로젝트: Harry27PL/si
function test(Neuron $neuron)
{
    $neuronResult = [];
    for ($x = MIN; $x <= MAX; $x += STEP) {
        $neuronResult[] = [$x, $neuron->border($x)];
    }
    $dots = [];
    foreach (getTestData() as $testData) {
        $dots[$testData->getExpectedResult()][] = [$testData->getData()[0], $testData->getData()[1]];
    }
    ?>

        <div class="graphs">
            <div class="graph2d" style="width:600px; height: 300px"
                    data-data="<?php 
    echo json_encode($neuronResult);
    ?>
"
                    data-dots="<?php 
    echo htmlspecialchars(json_encode($dots), ENT_QUOTES, 'UTF-8');
    ?>
"></div>
        </div>
        <script>draw()</script>

    <?php 
}