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
object RDDasMonadPlus { | |
import org.apache.spark.{ SparkContext } | |
import org.apache.spark.rdd.RDD | |
import scalaz._ | |
import Scalaz._ | |
import scala.reflect.ClassTag | |
// RDDMPlus is the type for which we will define the Monad instance. it can be | |
// constructed from an RDD using the RDDClassTag constructor. this | |
// implementation is based on insights from |
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
import akka.http.scaladsl.model.HttpHeader | |
import akka.http.scaladsl.model.HttpMethods._ | |
import akka.http.scaladsl.model.HttpResponse | |
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Credentials` | |
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Methods` | |
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Origin` | |
import akka.http.scaladsl.model.headers.Origin | |
import akka.http.scaladsl.server.Directive0 | |
import akka.http.scaladsl.server.Directives._ | |
import akka.http.scaladsl.server.MethodRejection |
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
$ sbt doc | |
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1G; support was removed in 8.0 | |
[info] Loading global plugins from /home/xxx/.sbt/0.13/plugins | |
[info] Loading project definition from /home/xxx/sbt_api_mappings/project | |
[info] Set current project to sbt_api_mappings (in build file:/home/xxx/sbt_api_mappings/) | |
scala.MatchError: scala-compiler-2.12.0-RC1.jar (of class java.lang.String) | |
at com.thoughtworks.sbtApiMappings.ApiMappings$$anonfun$projectSettings$3$$anonfun$apply$2.apply(ApiMappings.scala:41) | |
at com.thoughtworks.sbtApiMappings.ApiMappings$$anonfun$projectSettings$3$$anonfun$apply$2.apply(ApiMappings.scala:39) | |
at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:722) | |
at scala.collection.immutable.List.foreach(List.scala:318) |
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
trait L2Regularization extends com.thoughtworks.deeplearning.plugins.INDArrayWeights { | |
import org.nd4j.linalg.api.ndarray.INDArray | |
val l2Regularization: Double | |
trait INDArrayOptimizerApi extends super.INDArrayOptimizerApi { | |
this: INDArrayOptimizer => | |
abstract override def delta: INDArray = { | |
import org.nd4s.Implicits._ | |
super.delta + weight.data * l2Regularization |
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
trait L1Regularization extends INDArrayWeights { | |
val l1Regularization: Double | |
trait INDArrayOptimizerApi extends super.INDArrayOptimizerApi { | |
this: INDArrayOptimizer => | |
abstract override def delta: INDArray = { | |
import org.nd4s.Implicits._ | |
import org.nd4j.linalg.ops.transforms.Transforms | |
super.delta + Transforms.sign(weight.data) * l1Regularization | |
} |
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
trait CNNs | |
extends com.thoughtworks.deeplearning.plugins.INDArrayLayers | |
with com.thoughtworks.deeplearning.plugins.ImplicitsSingleton | |
with com.thoughtworks.deeplearning.plugins.Training | |
with com.thoughtworks.deeplearning.plugins.Operators { | |
import org.nd4j.linalg.api.ndarray.INDArray | |
import org.nd4j.linalg.convolution.Convolution | |
import org.nd4j.linalg.util.ArrayUtil | |
import org.nd4j.linalg.factory.Nd4j | |
import org.nd4j.linalg.api.ops.impl.transforms.IsMax |