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
package net.atos.sparti.pub | |
import java.io.PrintStream | |
import java.net.Socket | |
import org.apache.commons.pool2.impl.{DefaultPooledObject, GenericObjectPool} | |
import org.apache.commons.pool2.{ObjectPool, PooledObject, BasePooledObjectFactory} | |
import org.apache.spark.streaming.dstream.DStream | |
class PooledSocketStreamPublisher[T](host: String, port: Int) |
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
package botkop.sparti.receiver | |
import com.rabbitmq.client._ | |
import org.apache.spark.Logging | |
import org.apache.spark.storage.StorageLevel | |
import org.apache.spark.streaming.StreamingContext | |
import org.apache.spark.streaming.dstream.ReceiverInputDStream | |
import org.apache.spark.streaming.receiver.Receiver | |
import scala.reflect.ClassTag |
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 scala.language.postfixOps | |
import scala.util.Random | |
object LinearIterativeLearning extends App { | |
case class LabeledData(numFish: Int, numChips: Int, numKetchup: Int, price: Double = 0.0) | |
case class Weights(fish: Double, chips: Double, ketchup: Double) |
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
package botkop.nn.lecture3 | |
import scala.language.postfixOps | |
import scala.util.Random | |
object SigmoidIterativeLearning extends App { | |
case class LabeledData(numFish: Double, numChips: Double, numKetchup: Double, price: Double = 0.0) | |
case class Weights(fish: Double, chips: Double, ketchup: Double) | |
val trueWeights = Weights(0.150, 0.050, 0.100) |
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
case class SomeEvent(value: Long) | |
val events = Source | |
.tick(0 seconds, 250 millis, "") | |
.zipWithIndex | |
.map { case (_, l) => | |
SomeEvent(l) | |
} | |
val group = Flow[SomeEvent].groupedWithin(100, 500 millis) // +/- 2 events per group |
This file has been truncated, but you can view the full file.
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
ap Love whof wamp m rove mak waizor in! shenven wor gpear I d selve for trave sp | |
---- | |
iter 3326900, loss 40.139576923598945 | |
---- | |
ouc | |
O vow sppa'g nour love? | |
FhCVaxt let ard tave wak! por uppit. onoum--prroudix. | |
For tomn olip toor houk on trarid | |
Are I! | |
Wort deve wa?! |
This file has been truncated, but you can view the full file.
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
ap Love whof wamp m rove mak waizor in! shenven wor gpear I d selve for trave sp | |
---- | |
iter 3326900, loss 40.139576923598945 | |
---- | |
ouc | |
O vow sppa'g nour love? | |
FhCVaxt let ard tave wak! por uppit. onoum--prroudix. | |
For tomn olip toor houk on trarid | |
Are I! | |
Wort deve wa?! |
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
package scorch | |
import scorch.autograd._ | |
import botkop.numsca.Tensor | |
import botkop.{numsca => ns} | |
import org.scalactic.{Equality, TolerantNumerics} | |
import org.scalatest.{FlatSpec, Matchers} | |
class AutoGradSpec extends FlatSpec with Matchers { | |
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
package scorch.examples | |
import botkop.numsca.Tensor | |
import botkop.{numsca => ns} | |
import scorch.autograd._ | |
import scorch.nn.rnn.RecurrentModule | |
import scorch.nn.Optimizer | |
import scala.annotation.tailrec | |
import scala.io.Source |
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
package jtorch.cpu | |
import java.util.concurrent.atomic.AtomicLong | |
import com.typesafe.scalalogging.LazyLogging | |
import scala.concurrent.{Await, Future} | |
import scala.concurrent.duration._ | |
import scala.language.postfixOps |
OlderNewer