【问题标题】:CNTK complains about Feature Not ImplementedCNTK 抱怨未实现功能
【发布时间】:2017-01-12 22:36:10
【问题描述】:

我在 Brainscript 中有以下网络。

BrainScriptNetworkBuilder = {
    inputDim = 4
    labelDim = 1
    embDim = 20
    hiddenDim = 40

    model = Sequential (
        EmbeddingLayer {embDim} :                            # embedding
        RecurrentLSTMLayer {hiddenDim, goBackwards=false} :  # LSTM
        DenseLayer {labelDim}                                # output layer
    )

    # features
    t = DynamicAxis{}
    features = SparseInput {inputDim, tag="feature", dynamicAxis=t}
    anomaly  = Input {labelDim, tag="label"}

    # model application
    z = model (features)

    zp = ReconcileDynamicAxis(z, anomaly)

    # loss and metric
    ce   = CrossEntropyWithSoftmax (anomaly, zp)
    errs = ClassificationError     (anomaly, zp)

    featureNodes    = (features)
    labelNodes      = (anomaly)
    criterionNodes  = (ce)
    evaluationNodes = (errs)
    outputNodes     = (z)
}

我的数据如下所示:

2 |Features -0.08169 -0.07840 -0.09580 -0.08748 
2 |Features 0.00354 -0.00089 0.02832 0.00364 
2 |Features -0.18999 -0.12783 -0.02612 0.00474 
2 |Features 0.16097 0.11350 -0.01656 -0.05995 
2 |Features 0.09638 0.07632 -0.04359 0.02183 
2 |Features -0.12585 -0.08926 0.02879 -0.00414 
2 |Features -0.10224 -0.18541 -0.16963 -0.05655 
2 |Features 0.08327 0.15853 0.02869 -0.17020 
2 |Features -0.25388 -0.25438 -0.08348 0.13638 
2 |Features 0.20168 0.19566 -0.11165 -0.40739 |IsAnomaly 0

当我运行 cntk 命令尝试训练模型时,出现以下异常。

发生异常:内部文件:Matrix.cpp 行:1323 功能:Microsoft::MSR::CNTK::Matrix::SetValue -> 未实现功能。

我错过了什么?

【问题讨论】:

  • 你能把它作为一个问题发布到 CNTK 的 GitHub 上吗?

标签: cntk


【解决方案1】:

以下是一些建议:

  • 首先,输入应与阅读器中描述的数据类型匹配。所以特征变量不应该是稀疏的,因为数据中的输入是密集的。

  • 其次,LSTM 将输出一系列输出,输入序列中的每个样本对应一个输出。您需要忽略除最后一个以外的所有内容。

      model = Sequential ( DenseLayer {embDim} :  # embedding
                           RecurrentLSTMLayer {hiddenDim, goBackwards=false} :  # LSTM
                           BS.Sequences.Last :    #Use only the last in the LSTM sequence
                           DenseLayer {labelDim, activation=Sigmoid}  # output layer
                         )
    

【讨论】:

  • 不过,CNTK 在这里输出的错误信息一点用处都没有,因为它不能引导用户找到问题所在。我觉得错误消息至少应该包括网络中发生错误的位置,以及数据大小是多少。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-04-23
  • 2023-04-02
  • 1970-01-01
  • 2011-07-30
  • 1970-01-01
相关资源
最近更新 更多