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

Commit

Permalink
add depreciate and example changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lanking520 committed Jul 25, 2018
1 parent 9a1b1a1 commit 0369ba3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions scala-package/core/src/main/scala/org/apache/mxnet/IO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,11 @@ abstract class DataIter extends Iterator[DataBatch] {
def getIndex(): IndexedSeq[Long]

// The name and shape of data provided by this iterator
@deprecated
def provideData: ListMap[String, Shape]

// The name and shape of label provided by this iterator
@deprecated
def provideLabel: ListMap[String, Shape]

// Provide type:DataDesc of the data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ object TrainMnist {
"shuffle" -> "True",
"flat" -> flat,
"num_parts" -> kv.numWorkers.toString,
"part_index" -> kv.`rank`.toString))
"part_index" -> kv.`rank`.toString,
"dataLayout" -> "NT",
"labelLayout" -> "N"))

val eval = IO.MNISTIter(Map(
"image" -> (dataDir + "t10k-images-idx3-ubyte"),
Expand All @@ -87,7 +89,9 @@ object TrainMnist {
"batch_size" -> batchSize.toString,
"flat" -> flat,
"num_parts" -> kv.numWorkers.toString,
"part_index" -> kv.`rank`.toString))
"part_index" -> kv.`rank`.toString,
"dataLayout" -> "NT",
"labelLayout" -> "N"))

(train, eval)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ import org.apache.mxnet.Shape
import org.apache.mxnet.IO
import org.apache.mxnet.DataIter

/**
* @author Depeng Liang
*/
object Data {

// return train and val iterators for mnist
Expand All @@ -35,15 +32,19 @@ object Data {
"input_shape" -> inputShape.toString(),
"batch_size" -> s"$batchSize",
"shuffle" -> "True",
"flat" -> flat
"flat" -> flat,
"dataLayout" -> "NT",
"labelLayout" -> "N"
)
val trainDataIter = IO.MNISTIter(trainParams)
val testParams = Map(
"image" -> s"$dataPath/t10k-images-idx3-ubyte",
"label" -> s"$dataPath/t10k-labels-idx1-ubyte",
"input_shape" -> inputShape.toString(),
"batch_size" -> s"$batchSize",
"flat" -> flat
"flat" -> flat,
"dataLayout" -> "NT",
"labelLayout" -> "N"
)
val testDataIter = IO.MNISTIter(testParams)
(trainDataIter, testDataIter)
Expand Down

0 comments on commit 0369ba3

Please sign in to comment.