【问题标题】:CNTK C# Merge Inputs to a single OutputCNTK C# 将输入合并到单个输出
【发布时间】:2018-09-09 23:24:35
【问题描述】:

我正在尝试使用 CNTK C# 实现 Actor-Critic 模型。

花了几天时间搜索了一半的互联网,你是我最后的希望了 :)

我正在尝试将两个输入变量(两个具有相同尺寸的一维矩阵)“组合”成一个尺寸加倍的一维输出。

例如,让我们看一下以下代码:

var input1 = Variable.InputVariable(new[] { 9 }, DataType.Float, "input1");
var input2 = Variable.InputVariable(new[] { 9 }, DataType.Float, "input2");

var combined = Function.Combine(new[] {input1, input2});
// The following throws error
// var combinesVariable = new Variable(combined); 

抛出异常:

A Function instance 'Composite(Combine): Input('input1', [9], [*, #]), Input('input2', [9], [*, #]) -> Input('input1', [9], [*, #]), Input('input2', [9], [*, #])' with more than one output cannot be implicitly converted to a Variable.

最终,我想得到一个变量,其中(可能)两个输入尺寸为 [9],一个输出尺寸为 [18]。

【问题讨论】:

    标签: c# deep-learning actor cntk


    【解决方案1】:

    试试Splice 这应该允许您沿选定的轴连接变量。合并是为了从一对函数中创建新函数,因此我认为它们可以在图中作为一个步骤来查看。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-03
      • 1970-01-01
      • 2020-09-22
      相关资源
      最近更新 更多