Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
scala style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lanking520 committed Jul 22, 2018
1 parent 2d20032 commit d94ec27
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ object Lstm {
// embeding layer
val data = Symbol.Variable("data")
var label = Symbol.Variable("softmax_label")
val embed = Symbol.api.Embedding(data = Some(data), input_dim = inputSize, weight = Some(embedWeight),
output_dim = numEmbed, name = "embed")
val wordvec = Symbol.api.SliceChannel(data = Some(embed), num_outputs = seqLen, squeeze_axis = Some(true))
val embed = Symbol.api.Embedding(data = Some(data), input_dim = inputSize,
weight = Some(embedWeight), output_dim = numEmbed, name = "embed")
val wordvec = Symbol.api.SliceChannel(data = Some(embed),
num_outputs = seqLen, squeeze_axis = Some(true))

val hiddenAll = ArrayBuffer[Symbol]()
var dpRatio = 0f
Expand Down Expand Up @@ -133,8 +134,8 @@ object Lstm {

val data = Symbol.Variable("data")

var hidden = Symbol.api.Embedding(data = Some(data), input_dim = inputSize, weight = Some(embedWeight),
output_dim = numEmbed, name = "embed")
var hidden = Symbol.api.Embedding(data = Some(data), input_dim = inputSize,
weight = Some(embedWeight), output_dim = numEmbed, name = "embed")

var dpRatio = 0f
// stack LSTM
Expand All @@ -149,8 +150,8 @@ object Lstm {
}
// decoder
if (dropout > 0f) hidden = Symbol.api.Dropout(data = Some(hidden), p = Some(dropout))
val fc = Symbol.api.FullyConnected(data = Some(hidden), num_hidden = numLabel, weight = Some(clsWeight),
bias = Some(clsBias))
val fc = Symbol.api.FullyConnected(data = Some(hidden),
num_hidden = numLabel, weight = Some(clsWeight), bias = Some(clsBias))
val sm = Symbol.api.SoftmaxOutput(data = Some(fc), name = "softmax")
var output = Array(sm)
for (state <- lastStates) {
Expand Down

0 comments on commit d94ec27

Please sign in to comment.