Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,24 @@ import scala.collection.mutable.{ArrayBuffer, ListBuffer}
* This will run as a part of "make scalatest"
*/
class MultiTaskSuite extends FunSuite {

test("Multitask Test") {
val logger = LoggerFactory.getLogger(classOf[MultiTaskSuite])
logger.info("Multitask Test...")
if (System.getenv().containsKey("SCALA_TEST_ON_GPU") &&
System.getenv("SCALA_TEST_ON_GPU").toInt == 1) {
logger.info("Multitask Test...")

val batchSize = 100
val numEpoch = 10
val ctx = Context.cpu()
val batchSize = 100
val numEpoch = 3
val ctx = Context.gpu()

val modelPath = ExampleMultiTask.getTrainingData
val (executor, evalMetric) = ExampleMultiTask.train(batchSize, numEpoch, ctx, modelPath)
evalMetric.get.foreach { case (name, value) =>
assert(value >= 0.95f)
val modelPath = ExampleMultiTask.getTrainingData
val (executor, evalMetric) = ExampleMultiTask.train(batchSize, numEpoch, ctx, modelPath)
evalMetric.get.foreach { case (name, value) =>
assert(value >= 0.95f)
}
executor.dispose()
} else {
logger.info("GPU test only, skipped...")
}
executor.dispose()
}

}