Scala 无法使用声明的函数

Scala 无法使用声明的函数,scala,Scala,我有一段代码: val inputToClassifierIndex: ConnectionIndex = new ConnectionIndex(inputLayer, unsupervisedLayer) n2s3.addNetworkObserver(new SynapticWeightSelectGraphRef( for(outputIndex <- 0 until unsupervisedLayer.shape.getNumberOfPoints) yield

我有一段代码:

 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)
  )

以上操作很好,请您帮忙。

有什么错误吗?我想猜你在找什么,但这个问题似乎不完整。理想情况下,您还应该从示例代码中去掉所有与您看到的问题无关的内容,以便其他人可以更轻松地尝试和重现它。@DennisHunziker我肯定会做必要的编辑。
val iClassifierIndex: (String, String) => ConnectionIndex = {(originId: String, destinationId: String) => ConnectionIndex(name of my input layer, name of my output layer)}