Changed loss function to 1/2 ||x-y||^2 and updated the test cases to test the same.
Changed testing macros to EXPECT_NEAR.