All Projects → ThoughtWorksInc → Deeplearning.scala

ThoughtWorksInc / Deeplearning.scala

Licence: apache-2.0
A simple library for creating complex neural networks

Programming Languages

scala
5932 projects
dsl
153 projects

Projects that are alternatives of or similar to Deeplearning.scala

Deepdarkfantasy
A Programming Language for Deep Learning
Stars: ✭ 463 (-37.85%)
Mutual labels:  automatic-differentiation, functional-programming
Gorgonia
Gorgonia is a library that helps facilitate machine learning in Go.
Stars: ✭ 4,295 (+476.51%)
Mutual labels:  deep-neural-networks, automatic-differentiation
Neupy
NeuPy is a Tensorflow based python library for prototyping and building neural networks
Stars: ✭ 670 (-10.07%)
Mutual labels:  deep-neural-networks
Dl 4 Tsc
Deep Learning for Time Series Classification
Stars: ✭ 730 (-2.01%)
Mutual labels:  deep-neural-networks
Deepfacelab
DeepFaceLab is the leading software for creating deepfakes.
Stars: ✭ 30,308 (+3968.19%)
Mutual labels:  deep-neural-networks
Android Tensorflow Lite Example
Android TensorFlow Lite Machine Learning Example
Stars: ✭ 681 (-8.59%)
Mutual labels:  deep-neural-networks
Static Land
Specification for common algebraic structures in JavaScript based on Fantasy Land
Stars: ✭ 699 (-6.17%)
Mutual labels:  functional-programming
Segan
Speech Enhancement Generative Adversarial Network in TensorFlow
Stars: ✭ 661 (-11.28%)
Mutual labels:  deep-neural-networks
Lambda
Functional patterns for Java
Stars: ✭ 737 (-1.07%)
Mutual labels:  functional-programming
Yolo Tf2
yolo(all versions) implementation in keras and tensorflow 2.4
Stars: ✭ 695 (-6.71%)
Mutual labels:  deep-neural-networks
Frameless
Expressive types for Spark.
Stars: ✭ 717 (-3.76%)
Mutual labels:  functional-programming
Optional
A robust option type for C#
Stars: ✭ 690 (-7.38%)
Mutual labels:  functional-programming
Mlton
The MLton repository
Stars: ✭ 683 (-8.32%)
Mutual labels:  functional-programming
Softlearning
Softlearning is a reinforcement learning framework for training maximum entropy policies in continuous domains. Includes the official implementation of the Soft Actor-Critic algorithm.
Stars: ✭ 713 (-4.3%)
Mutual labels:  deep-neural-networks
Torchsde
Differentiable SDE solvers with GPU support and efficient sensitivity analysis.
Stars: ✭ 678 (-8.99%)
Mutual labels:  deep-neural-networks
Moon
🌙 The minimal & fast library for functional user interfaces
Stars: ✭ 6,058 (+713.15%)
Mutual labels:  functional-programming
Adversarial video generation
A TensorFlow Implementation of "Deep Multi-Scale Video Prediction Beyond Mean Square Error" by Mathieu, Couprie & LeCun.
Stars: ✭ 662 (-11.14%)
Mutual labels:  deep-neural-networks
Pytorch Multi Style Transfer
Neural Style and MSG-Net
Stars: ✭ 687 (-7.79%)
Mutual labels:  deep-neural-networks
Keras Attention
Visualizing RNNs using the attention mechanism
Stars: ✭ 697 (-6.44%)
Mutual labels:  deep-neural-networks
Emopy
A deep neural net toolkit for emotion analysis via Facial Expression Recognition (FER)
Stars: ✭ 744 (-0.13%)
Mutual labels:  deep-neural-networks

DeepLearning.scala ThoughtWorks

Join the chat at https://gitter.im/ThoughtWorksInc/DeepLearning.scala Build Status Latest version Scaladoc

DeepLearning.scala is a simple library for creating complex neural networks from object-oriented and functional programming constructs.

  • DeepLearning.scala runs on JVM, can be used either in standalone JVM applications or a Jupyter Notebooks.
  • DeepLearning.scala is expressive. Various types of neural network layers can be created by composing map, reduce or other higher order functions.
  • DeepLearning.scala supports plugins. There are various plugins providing algorithms, models, hyperparameters or other features.
  • All the above features are statically type checked.

Features

Differentiable programming

Like other deep learning toolkits, DeepLearning.scala allows you to build neural networks from mathematical formulas. It supports floats, doubles, GPU-accelerated N-dimensional arrays, and calculates derivatives of the weights in the formulas.

Dynamic neural networks

Unlike some other deep learning toolkits, the structure of neural networks in DeepLearning.scala is dynamically determined during running. Our neural networks are programs. All Scala features, including functions, expressions and control flows, are available in neural networks.

For example:

def ordinaryScalaFunction(a: INDArray): Boolean = {
  a.signnum.sumT > math.random
}

def myDynamicNeuralNetwork(input: INDArray) = INDArrayLayer(monadic[Do] {
  val outputOfLayer1 = layer1(input).forward.each
  if (ordinaryScalaFunction(outputOfLayer1.data)) {
    dynamicallySelectedLayer2(outputOfLayer1).forward.each
  } else {
    dynamicallySelectedLayer3(outputOfLayer1).forward.each
  }
})

The above neural network will go into different subnetworks according to an ordinary Scala function.

With the ability of creating dynamic neural networks, regular programmers are able to build complex neural networks from simple code. You write code almost as usual, the only difference being that code based on DeepLearning.scala is differentiable, which enables such code to evolve by modifying its parameters continuously.

Functional programming

DeepLearning.scala 2.0 is based on Monads, which are composable, thus a complex layer can be built from primitive operators or higher order functions like map/reduce. Along with the Monad, we provide an Applicative type class, to perform multiple calculations in parallel.

For example, the previous example can be rewritten in higher-order function style as following:

def myDynamicNeuralNetwork(input: INDArray) = INDArrayLayer {
  layer1(input).forward.flatMap { outputOfLayer1 =>
    if (ordinaryScalaFunction(outputOfLayer1.data)) {
      dynamicallySelectedLayer2(outputOfLayer1).forward
    } else {
      dynamicallySelectedLayer3(outputOfLayer1).forward
    }
  }
}

The key construct in DeepLearning.scala 2.0 is the dependent type class DeepLearning, which witnesses a differentiable expression. In other words, given the DeepLearning type class instance, you can activate the deep learning ability of any type.

Object-oriented programming

The code base of DeepLearning.scala 2.0 is organized according to Dependent Object Type calculus (DOT). All features are provided as mixin-able plugins. A plugin is able to change APIs and behaviors of all DeepLearning.scala types. This approach not only resolves expression problem, but also gives plugins the additional ability of virtually depending on other plugins.

For example, when a plugin author is creating the Adagrad optimizer plugin, he does not have to explicitly call functions related to learning rate. However, once a plugin user enables both the Adagrad plugin and the FixedLearningRate plugin, then computation in FixedLearningRate will get called eventually when the Adagrad optimization is executed.

Roadmap

v2.0

Version 2.0 is the current version with all of the above features.

v3.0

  • Support element-wise map/reduce and other higher-order functions on GPU.
  • Support distributed models and distributed training on Spark.

Links

Acknowledgements

DeepLearning.scala is sponsored by ThoughtWorks.

DeepLearning.scala is heavily inspired by my colleague @MarisaKirisame. Originally, we worked together on a prototype of a deep learning framework, and eventually split our work into this project and DeepDarkFantasy. Other contributors can be found at here.

Related projects

  • Shapeless provides a solid foundation for type-level programming used in DeepLearning.scala.
  • Scalaz and Algebra provides type classes used in DeepLearning.scala.
  • ThoughtWorks Each provides async/await-like syntax. You may want to use it to control your training process in an imperative style.
  • nd4j provides numerical computing used in DeepLearning.scala 2.0.
  • Compute.scala provides numerical computing used in DeepLearning.scala 3.0.
  • RAII.scala, future.scala and tryt.scala provides monadic asynchronous resource management used in DeepLearning.scala.
  • Plugins of DeepLearning.scala are based on Factory and other dependent type classes in feature.scala.
  • Import.scala is a Scala compiler plugin that enables magic imports. You may need it in those sbt project use DeepLearning.scala plugin hosted on Github Gist.
  • DeepLearning.scala can run in Jupyter Scala or Ammonite.
  • The unit tests of DeepLearning.scala are written in ScalaTest and example.scala syntax.
  • Some type classes in DeepLearning.scala are created by simulacrum's @typeclass annotation.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].