无法使用声明的函数

时间:2018-06-25 13:28:26

标签: scala

我有一段代码:

 val inputToClassifierIndex: ConnectionIndex = new ConnectionIndex(inputLayer, unsupervisedLayer)

  n2s3.addNetworkObserver(new SynapticWeightSelectGraphRef(
    for(outputIndex <- 0 until unsupervisedLayer.shape.getNumberOfPoints) yield {
      for(inputX <- 0 until InputMnist.shape.dimensions(0)) yield {
        for(inputY <- 0 until InputMnist.shape.dimensions(1)) yield {
          val input = inputLayer.getNeuronPathAt(inputX, inputY)
          val output = unsupervisedLayer.getNeuronPathAt(outputIndex)
          inputToClassifierIndex.getConnectionsBetween(input, output).head
        }
      }
    },
    SynapticWeightSelectGraph.heatMap,
    4,
    100)
  )

您可以看到inputToClassifierIndex中使用了n2s3.addNetworkObserver

现在我已经定义了一个DSL,我试图在其中定义相同的

val iClassifierIndex: ConnectionIndex = new ConnectionIndex(name of my input layer, name of my output layer)

但是它抛出错误 而

val iClassifierIndex: (String, String) => ConnectionIndex = {(originId: String, destinationId: String) => ConnectionIndex(name of my input layer, name of my output layer)}

上面的方法很好,请您帮忙。

0 个答案:

没有答案