Closed beomyeol closed 8 years ago
I've added ReLU, identity, absolute value, square and hyperbolic tangent function. Please take a look at these too.
I changed the assumption that the argument of derivative()
method is the return value of apply()
. In this case, derivates of the absolute value function and the square function cannot be derived from their return values because the signs of original inputs are lost by apply()
operation. Thus, I removed the absolute value and square functions.
I did a pass, @beomyeol. It would've been painful to write this code; thanks a lot!
@jsjason I addressed your comments. Please take another look.
@beomyeol This looks great. I'll merge this after you address my new comments.
@jsjason Thanks for your review. I've addressed your new comments :)
Since
Nd4j
has several problem as mentioned in #142, this pull request introduces a newMatrix
interface that supportsfloat
data type and will replaceNd4j
library, and an implementation based on jblas. The interface ofMatrix
is motivated by jblas'sFloatMatrix
, but does not have all methods ofFloatMatrix
. We can add methods which have not been implemented later if needed. In addition, this pull request also introducesFunction
interface for activation functions andMatrixUtils
, a utility class forMatrix
. The implementation of a sigmoid function is included in this PR and other implementations such as ReLU, Softmax, Tanh will be added later.MatrixUtils
provides functions for comparison andreadNumpy()
for loading matrix data from Numpy-compatible plain text files.