mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 01:34:22 +00:00
Format code
This commit is contained in:
@@ -14,7 +14,6 @@ class ActivationsTest : public CublasTestFixture {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(ActivationsTest, SigmoidSanityCheck) {
|
TEST_F(ActivationsTest, SigmoidSanityCheck) {
|
||||||
|
|
||||||
float input[3] = {-100.0f, 0.0f, 100.0f};
|
float input[3] = {-100.0f, 0.0f, 100.0f};
|
||||||
|
|
||||||
std::vector<float> expected_output = {0.0f, 0.5f, 1.0f};
|
std::vector<float> expected_output = {0.0f, 0.5f, 1.0f};
|
||||||
@@ -37,7 +36,8 @@ TEST_F(ActivationsTest, SigmoidSanityCheck) {
|
|||||||
|
|
||||||
std::vector<float> output(3);
|
std::vector<float> output(3);
|
||||||
|
|
||||||
cublasStatus = cublasGetVector(3, sizeof(float), d_output, 1, output.data(), 1);
|
cublasStatus =
|
||||||
|
cublasGetVector(3, sizeof(float), d_output, 1, output.data(), 1);
|
||||||
EXPECT_EQ(cublasStatus, CUBLAS_STATUS_SUCCESS);
|
EXPECT_EQ(cublasStatus, CUBLAS_STATUS_SUCCESS);
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
|
|||||||
@@ -209,9 +209,7 @@ TEST_F(DenseLayerTest, ForwardRandomWeightMatrixSigmoid) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < outputSize; ++i) {
|
for (int i = 0; i < outputSize; ++i) {
|
||||||
EXPECT_NEAR(
|
EXPECT_NEAR(output[i], expectedOutput[i], 1e-5);
|
||||||
output[i], expectedOutput[i], 1e-5
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
commonTestTeardown(d_input, d_output);
|
commonTestTeardown(d_input, d_output);
|
||||||
|
|||||||
Reference in New Issue
Block a user