-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e24861
commit 3f04deb
Showing
4 changed files
with
79 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
examples/src/test/scala/com/eharmony/spotz/examples/AckleyTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.eharmony.spotz.examples | ||
|
||
import org.junit.Assert._ | ||
import org.junit.{Ignore, Test} | ||
|
||
/** | ||
* @author vsuthichai | ||
*/ | ||
class AckleyTest { | ||
@Ignore | ||
def testAckleyParRandomSearch() { | ||
val result = AckleyParRandomSearch() | ||
val point = result.bestPoint | ||
|
||
assertEquals(result.bestLoss, 0.0, 0.002) | ||
assertEquals(point.get[Double]("x"), 0.0, 0.001) | ||
assertEquals(point.get[Double]("y"), 0.0, 0.001) | ||
} | ||
|
||
@Test | ||
def testAckleyParGridSearch() { | ||
val result = AckleyParGridSearch() | ||
val point = result.bestPoint | ||
|
||
assertEquals(result.bestLoss, 0.0, 0.002) | ||
assertEquals(point.get[Double]("x"), 0.0, 0.001) | ||
assertEquals(point.get[Double]("y"), 0.0, 0.001) | ||
} | ||
|
||
@Ignore | ||
def testAckleySparkRandomSearch() { | ||
val result = AckleySparkRandomSearch() | ||
val point = result.bestPoint | ||
|
||
assertEquals(result.bestLoss, 0.0, 0.002) | ||
assertEquals(point.get[Double]("x"), 0.0, 0.001) | ||
assertEquals(point.get[Double]("y"), 0.0, 0.001) | ||
} | ||
|
||
@Test | ||
def testAckleySparkGridSearch() { | ||
val result = AckleySparkGridSearch() | ||
val point = result.bestPoint | ||
|
||
assertEquals(result.bestLoss, 0.0, 0.002) | ||
assertEquals(point.get[Double]("x"), 0.0, 0.001) | ||
assertEquals(point.get[Double]("y"), 0.0, 0.001) | ||
} | ||
} | ||
|