Skip to content

Commit 87b63a7

Browse files
committed
Intial commit
1 parent f41a3af commit 87b63a7

136 files changed

Lines changed: 1706 additions & 7697 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/NeuralNet/ActivationFunctions/ELU/Exceptions/InvalidAlphaException.php renamed to src/Exceptions/InvalidAlphaException.php

File renamed without changes.

src/NeuralNet/Initializers/Uniform/Exceptions/InvalidBetaException.php renamed to src/Exceptions/InvalidBetaException.php

File renamed without changes.

src/NeuralNet/Initializers/Base/Exceptions/InvalidFanInException.php renamed to src/Exceptions/InvalidFanInException.php

File renamed without changes.

src/NeuralNet/Initializers/Base/Exceptions/InvalidFanOutException.php renamed to src/Exceptions/InvalidFanOutException.php

File renamed without changes.

src/NeuralNet/ActivationFunctions/LeakyReLU/Exceptions/InvalidLeakageException.php renamed to src/Exceptions/InvalidLeakageException.php

File renamed without changes.

src/NeuralNet/Initializers/Normal/Exceptions/InvalidStandardDeviationException.php renamed to src/Exceptions/InvalidStandardDeviationException.php

File renamed without changes.

src/NeuralNet/ActivationFunctions/ThresholdedReLU/Exceptions/InvalidThresholdException.php renamed to src/Exceptions/InvalidThresholdException.php

File renamed without changes.
Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22

3-
namespace Rubix\ML\NeuralNet\ActivationFunctions;
3+
declare(strict_types=1);
44

5-
use Tensor\Matrix;
5+
namespace Rubix\ML\NeuralNet\ActivationFunctions\Base\Contracts;
6+
7+
use NDArray;
68
use Stringable;
79

810
/**
@@ -11,27 +13,15 @@
1113
* @category Machine Learning
1214
* @package Rubix/ML
1315
* @author Andrew DalPino
16+
* @author Aleksei Nechaev <omfg.rus@gmail.com>
1417
*/
1518
interface ActivationFunction extends Stringable
1619
{
1720
/**
1821
* Compute the activation.
1922
*
20-
* @internal
21-
*
22-
* @param Matrix $input
23-
* @return Matrix
24-
*/
25-
public function activate(Matrix $input) : Matrix;
26-
27-
/**
28-
* Calculate the derivative of the activation.
29-
*
30-
* @internal
31-
*
32-
* @param Matrix $input
33-
* @param Matrix $output
34-
* @return Matrix
23+
* @param NDArray $input Input matrix
24+
* @return NDArray Output matrix
3525
*/
36-
public function differentiate(Matrix $input, Matrix $output) : Matrix;
26+
public function activate(NDArray $input) : NDArray;
3727
}

src/NeuralNet/ActivationFunctions/Base/Contracts/ActivationFunction.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/NeuralNet/ActivationFunctions/Base/Contracts/Derivative.php renamed to src/NeuralNet/ActivationFunctions/Derivative.php

File renamed without changes.

0 commit comments

Comments
 (0)