Skip to content

Commit 94c2f3e

Browse files
Delete the MergeConfiguration dropout property
1 parent a807c34 commit 94c2f3e

File tree

10 files changed

+26
-46
lines changed

10 files changed

+26
-46
lines changed

src/main/kotlin/com/kotlinnlp/simplednn/core/layers/models/merge/mergeconfig/AffineMerge.kt

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,16 @@ import com.kotlinnlp.simplednn.core.functionalities.activations.ActivationFuncti
1111
import com.kotlinnlp.simplednn.core.layers.LayerType
1212

1313
/**
14-
* A data class that defines the configuration of an Affine layer.
14+
* The Affine merge layer configuration.
1515
*
1616
* @property outputSize the size of the merged output
1717
* @property activationFunction the output activation function
18-
* @property dropout the probability of dropout
1918
*/
2019
class AffineMerge(
2120
outputSize: Int,
22-
activationFunction: ActivationFunction? = null,
23-
dropout: Double = 0.0
24-
) : OpenOutputMerge(
21+
activationFunction: ActivationFunction? = null
22+
) : VariableOutputMergeConfig(
2523
type = LayerType.Connection.Affine,
26-
dropout = dropout,
2724
outputSize = outputSize,
2825
activationFunction = activationFunction
2926
)

src/main/kotlin/com/kotlinnlp/simplednn/core/layers/models/merge/mergeconfig/AvgMerge.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ package com.kotlinnlp.simplednn.core.layers.models.merge.mergeconfig
1010
import com.kotlinnlp.simplednn.core.layers.LayerType
1111

1212
/**
13-
* A data class that defines the configuration of an Avg layer.
14-
*
15-
* @property dropout the probability of dropout
13+
* The Avg merge layer configuration.
1614
*/
17-
class AvgMerge(dropout: Double = 0.0) : MergeConfiguration(type = LayerType.Connection.Avg, dropout = dropout)
15+
class AvgMerge : MergeConfiguration(type = LayerType.Connection.Avg)

src/main/kotlin/com/kotlinnlp/simplednn/core/layers/models/merge/mergeconfig/BiaffineMerge.kt

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,16 @@ import com.kotlinnlp.simplednn.core.functionalities.activations.ActivationFuncti
1111
import com.kotlinnlp.simplednn.core.layers.LayerType
1212

1313
/**
14-
* A data class that defines the configuration of a Biaffine layer.
14+
* The Biaffine merge layer configuration.
1515
*
1616
* @property outputSize the size of the merged output
1717
* @property activationFunction the output activation function
18-
* @property dropout the probability of dropout
1918
*/
2019
class BiaffineMerge(
2120
outputSize: Int,
22-
activationFunction: ActivationFunction? = null,
23-
dropout: Double = 0.0
24-
) : OpenOutputMerge(
21+
activationFunction: ActivationFunction? = null
22+
) : VariableOutputMergeConfig(
2523
type = LayerType.Connection.Biaffine,
26-
dropout = dropout,
2724
outputSize = outputSize,
2825
activationFunction = activationFunction
2926
)

src/main/kotlin/com/kotlinnlp/simplednn/core/layers/models/merge/mergeconfig/ConcatFeedforwardMerge.kt

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,16 @@ import com.kotlinnlp.simplednn.core.functionalities.activations.ActivationFuncti
1111
import com.kotlinnlp.simplednn.core.layers.LayerType
1212

1313
/**
14-
* A data class that defines the configuration of a Concat layer followed by a feed-forward layer.
14+
* The ConcatFeedforward merge layer configuration.
1515
*
1616
* @property outputSize the size of the merged output
1717
* @property activationFunction the output activation function
18-
* @property dropout the probability of dropout
1918
*/
2019
class ConcatFeedforwardMerge(
2120
outputSize: Int,
22-
activationFunction: ActivationFunction? = null,
23-
dropout: Double = 0.0
24-
) : OpenOutputMerge(
21+
activationFunction: ActivationFunction? = null
22+
) : VariableOutputMergeConfig(
2523
type = LayerType.Connection.ConcatFeedforward,
26-
dropout = dropout,
2724
outputSize = outputSize,
2825
activationFunction = activationFunction
2926
)

src/main/kotlin/com/kotlinnlp/simplednn/core/layers/models/merge/mergeconfig/ConcatMerge.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ package com.kotlinnlp.simplednn.core.layers.models.merge.mergeconfig
1010
import com.kotlinnlp.simplednn.core.layers.LayerType
1111

1212
/**
13-
* A data class that defines the configuration of a Concat layer.
14-
*
15-
* @property dropout the probability of dropout
13+
* The Concat merge layer configuration.
1614
*/
17-
class ConcatMerge(dropout: Double = 0.0) : MergeConfiguration(type = LayerType.Connection.Concat, dropout = dropout)
15+
class ConcatMerge : MergeConfiguration(type = LayerType.Connection.Concat)

src/main/kotlin/com/kotlinnlp/simplednn/core/layers/models/merge/mergeconfig/MergeConfiguration.kt

+4-5
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ package com.kotlinnlp.simplednn.core.layers.models.merge.mergeconfig
1010
import com.kotlinnlp.simplednn.core.layers.LayerType
1111

1212
/**
13-
* A class that defines the configuration of a Merge layer.
13+
* The configuration of a merge layer.
1414
*
15-
* @property type the connection type of the output Merge layer
16-
* @property dropout the probability of dropout
15+
* @property type the connection type
1716
*/
18-
abstract class MergeConfiguration(val type: LayerType.Connection, val dropout: Double) {
17+
abstract class MergeConfiguration(val type: LayerType.Connection) {
1918

2019
/**
21-
* Check connection type.
20+
* Check the connection type.
2221
*/
2322
init {
2423
require(this.type.property == LayerType.Property.Merge)

src/main/kotlin/com/kotlinnlp/simplednn/core/layers/models/merge/mergeconfig/ProductMerge.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ package com.kotlinnlp.simplednn.core.layers.models.merge.mergeconfig
1010
import com.kotlinnlp.simplednn.core.layers.LayerType
1111

1212
/**
13-
* A data class that defines the configuration of a Product layer.
14-
*
15-
* @property dropout the probability of dropout
13+
* The Product merge layer configuration.
1614
*/
17-
class ProductMerge(dropout: Double = 0.0) : MergeConfiguration(type = LayerType.Connection.Product, dropout = dropout)
15+
class ProductMerge : MergeConfiguration(type = LayerType.Connection.Product)

src/main/kotlin/com/kotlinnlp/simplednn/core/layers/models/merge/mergeconfig/SumMerge.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ package com.kotlinnlp.simplednn.core.layers.models.merge.mergeconfig
1010
import com.kotlinnlp.simplednn.core.layers.LayerType
1111

1212
/**
13-
* A data class that defines the configuration of a Sum layer.
14-
*
15-
* @property dropout the probability of dropout
13+
* The Sum merge layer configuration.
1614
*/
17-
class SumMerge(dropout: Double = 0.0) : MergeConfiguration(type = LayerType.Connection.Sum, dropout = dropout)
15+
class SumMerge : MergeConfiguration(type = LayerType.Connection.Sum)

src/main/kotlin/com/kotlinnlp/simplednn/core/layers/models/merge/mergeconfig/OpenOutputMerge.kt src/main/kotlin/com/kotlinnlp/simplednn/core/layers/models/merge/mergeconfig/VariableOutputMergeConfig.kt

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ import com.kotlinnlp.simplednn.core.functionalities.activations.ActivationFuncti
1111
import com.kotlinnlp.simplednn.core.layers.LayerType
1212

1313
/**
14-
* A class that defines the configuration of the Merge layer has a configurable output size and activation.
14+
* The configuration of a merge layer with a variable output size and and an optional activation function.
1515
*
16-
* @property type the connection type of the output Merge layer
17-
* @property dropout the probability of dropout
16+
* @property type the connection type
1817
* @property outputSize the size of the merged output
1918
* @property activationFunction the output activation function
2019
*/
21-
abstract class OpenOutputMerge(
20+
abstract class VariableOutputMergeConfig(
2221
type: LayerType.Connection,
23-
dropout: Double,
2422
val outputSize: Int,
2523
val activationFunction: ActivationFunction?
26-
) : MergeConfiguration(type = type, dropout = dropout)
24+
) : MergeConfiguration(type)

src/main/kotlin/com/kotlinnlp/simplednn/deeplearning/attention/pointernetwork/PointerNetworkModel.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class PointerNetworkModel(
6969
sizes = listOf(this.inputSize, this.vectorSize)),
7070
LayerInterface(
7171
size = this.mergeOutputSize,
72-
activationFunction = (mergeConfig as? OpenOutputMerge)?.activationFunction,
72+
activationFunction = (mergeConfig as? VariableOutputMergeConfig)?.activationFunction,
7373
connectionType = mergeConfig.type),
7474
weightsInitializer = weightsInitializer,
7575
biasesInitializer = biasesInitializer)

0 commit comments

Comments
 (0)