Skip to content

Commit 1cbfe76

Browse files
committed
Improve Scaladoc
1 parent 1e2e2fe commit 1cbfe76

File tree

12 files changed

+39
-9
lines changed
  • plugins-Builtins/src/main/scala-2.11/com/thoughtworks/deeplearning/plugins
  • plugins-FloatWeights/src/main/scala/com/thoughtworks/deeplearning/plugins
  • plugins-INDArrayWeights
  • plugins-ImplicitsSingleton/src/main/scala/com/thoughtworks/deeplearning/plugins
  • plugins-Layers/src/main/scala/com/thoughtworks/deeplearning/plugins
  • plugins-Logging/src/main/scala/com/thoughtworks/deeplearning/plugins
  • plugins-Operators/src/main/scala/com/thoughtworks/deeplearning/plugins
  • plugins-RawFloatLayers/src/main/scala-2.11/com/thoughtworks/deeplearning/plugins
  • plugins-RawINDArrayLayers/src/main/scala-2.11/com/thoughtworks/deeplearning/plugins
  • plugins-Training/src/main/scala/com/thoughtworks/deeplearning/plugins
  • plugins-Weights/src/main/scala/com/thoughtworks/deeplearning/plugins

12 files changed

+39
-9
lines changed

plugins-Builtins/src/main/scala-2.11/com/thoughtworks/deeplearning/plugins/Builtins.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.thoughtworks.deeplearning.plugins
22

33
/** A plugin that enables all other DeepLearning.scala built-in plugins.
44
*
5-
* @example When creating a [[Builtins]] from [[com.thoughtworks.feature.Factory]],
5+
* @example When creating a [[Builtins]] from [[com.thoughtworks.feature.Factory$.apply Factory]],
66
*
77
* {{{
88
* import com.thoughtworks.feature.Factory

plugins-FloatWeights/src/main/scala/com/thoughtworks/deeplearning/plugins/FloatWeights.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ trait FloatWeights extends Weights {
2323
override protected type Optimizer = FloatOptimizer
2424

2525
}
26+
27+
/** @template */
2628
type FloatWeight <: FloatWeightApi with Weight
2729

2830
@inject
@@ -42,7 +44,7 @@ trait FloatWeights extends Weights {
4244

4345
trait FloatOptimizerApi extends OptimizerApi { this: FloatOptimizer =>
4446

45-
type Delta = Float
47+
override type Delta = Float
4648

4749
override protected type Weight = FloatWeight
4850

@@ -55,6 +57,8 @@ trait FloatWeights extends Weights {
5557
}
5658

5759
}
60+
61+
/** @template */
5862
type FloatOptimizer <: FloatOptimizerApi with Optimizer
5963

6064
}

plugins-INDArrayWeights/build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ libraryDependencies ++= {
1616
"org.nd4j" % "nd4j-native-platform" % "0.8.0" % Test)
1717
}
1818
}
19+
20+
enablePlugins(Example)

plugins-INDArrayWeights/src/main/scala-2.11/com/thoughtworks/deeplearning/plugins/INDArrayWeights.scala

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ import annotation.meta.getter
1212
import scala.concurrent.ExecutionContext
1313
import scalaz.syntax.all._
1414

15-
/**
15+
/** A plugin to create [[org.nd4j.linalg.api.ndarray.INDArray INDArray]] weight.
16+
*
1617
* @author 杨博 (Yang Bo)
1718
*/
1819
trait INDArrayWeights extends Weights with ImplicitsSingleton {
1920

2021
@inject
2122
implicit protected def deepLearningExecutionContext: ExecutionContext
2223

23-
type Implicits <: ImplicitsApi
24+
override type Implicits <: ImplicitsApi
2425

2526
import implicits._
2627

@@ -31,6 +32,8 @@ trait INDArrayWeights extends Weights with ImplicitsSingleton {
3132
override protected type Optimizer = INDArrayOptimizer
3233

3334
}
35+
36+
/** @template */
3437
type INDArrayWeight <: INDArrayWeightApi with Weight
3538

3639
@inject
@@ -50,7 +53,7 @@ trait INDArrayWeights extends Weights with ImplicitsSingleton {
5053

5154
trait INDArrayOptimizerApi extends OptimizerApi { this: INDArrayOptimizer =>
5255

53-
type Delta = INDArray
56+
override type Delta = INDArray
5457

5558
override protected type Weight = INDArrayWeight
5659

@@ -64,6 +67,8 @@ trait INDArrayWeights extends Weights with ImplicitsSingleton {
6467
}
6568

6669
}
70+
71+
/** @template */
6772
type INDArrayOptimizer <: INDArrayOptimizerApi with Optimizer
6873

6974
}

plugins-ImplicitsSingleton/src/main/scala/com/thoughtworks/deeplearning/plugins/ImplicitsSingleton.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import Factory.inject
77

88
import scala.annotation.meta.getter
99

10+
/** A plugin that creates the instance of [[implicits]].
11+
*
12+
* Any fields and methods in [[Implicits]] added by other plugins will be mixed-in and present in [[implicits]].
13+
*/
1014
trait ImplicitsSingleton {
1115
type Implicits
1216

plugins-Layers/src/main/scala/com/thoughtworks/deeplearning/plugins/Layers.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ trait Layers {
2525
protected def handleException(thrown: Throwable): Unit = ()
2626

2727
}
28+
29+
/** @template */
2830
type Layer <: LayerApi
2931
object Layer {
3032
type Aux[Data0, Delta0] = Layer {
@@ -46,6 +48,7 @@ trait Layers {
4648
}
4749
}
4850

51+
/** @template */
4952
type Implicits <: ImplicitsApi
5053

5154
}

plugins-Logging/src/main/scala/com/thoughtworks/deeplearning/plugins/Logging.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ object Logging {
5858

5959
}
6060

61-
/**
61+
/** A plugin that logs uncaught exceptions raised from [[Layer]] and [[Weight]].
62+
*
6263
* @author 杨博 (Yang Bo)
6364
*/
6465
trait Logging extends Layers with Weights {
@@ -78,15 +79,15 @@ trait Logging extends Layers with Weights {
7879
logger.log(new ThrownInLayer(this, thrown))
7980
}
8081
}
81-
type Layer <: LayerApi
82+
override type Layer <: LayerApi
8283

8384
trait WeightApi extends super.WeightApi with LoggingContext { this: Weight =>
8485
override protected def handleException(thrown: Throwable): Unit = {
8586
super.handleException(thrown)
8687
logger.log(new ThrownInWeight(this, thrown))
8788
}
8889
}
89-
type Weight <: WeightApi
90+
override type Weight <: WeightApi
9091
override type Implicits <: super[Layers].ImplicitsApi with super[Weights].ImplicitsApi
9192

9293
}

plugins-Operators/src/main/scala/com/thoughtworks/deeplearning/plugins/Operators.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.thoughtworks.deeplearning
22
package plugins
33
import shapeless.{Poly1, Poly2}
44

5-
/** A namespace of definitions of polymorphic operators.
5+
/** A plugin of definitions of polymorphic operators.
66
*
77
* Those functions are implemented in [[RawFloatLayers]], [[RawDoubleLayers]] and [[RawINDArrayLayers]].
88
* @author 杨博 (Yang Bo)
@@ -45,6 +45,8 @@ trait Operators {
4545

4646
}
4747
}
48+
49+
/** @template */
4850
type Implicits <: ImplicitsApi
4951

5052
}

plugins-RawFloatLayers/src/main/scala-2.11/com/thoughtworks/deeplearning/plugins/RawFloatLayers.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ trait RawFloatLayers extends Layers {
202202

203203
override type Implicits <: ImplicitsApi
204204

205+
/** @template */
205206
type FloatLayer <: FloatLayerApi with Layer
206207

207208
@inject

plugins-RawINDArrayLayers/src/main/scala-2.11/com/thoughtworks/deeplearning/plugins/RawINDArrayLayers.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ trait RawINDArrayLayers extends RawDoubleLayers with DoubleLiterals with Implici
577577

578578
override type Implicits <: ImplicitsApi
579579

580+
/** @template */
580581
type INDArrayLayer <: INDArrayLayerApi with Layer
581582

582583
@inject

0 commit comments

Comments
 (0)