如何找到最多2个数字?
value = -9999
run = problem.getscore()
Run Code Online (Sandbox Code Playgroud)
我需要比较2 value和ie的值,run并找到最大值2.我需要一些python函数来操作它?
我有一个训练集,以这种方式输入和输出:
Input:
0.832 64.643
0.818 78.843
1.776 45.049
0.597 88.302
1.412 63.458
1.468 49.535
1.985 33.387
2.073 30.279
1.431 55.231
1.116 68.521
1.617 44.362
2.159 66.512
Output:
0 0 1
0 0 1
0 1 0
0 0 1
0 0 1
1 0 0
0 0 1
1 0 0
1 0 0
0 0 1
0 0 1
0 1 0
1 0 0
1 0 0
0 1 0
0 1 0
Run Code Online (Sandbox Code Playgroud)
我需要实现一个线性层神经网络,它可以在MATLAB中最好地表示数据集.在MATLAB中用它做什么算法?
目标输出为"1表示相应输入所属的特定类,"0表示其余2个输出.
s = problem.getSuccessors(currNode)
print s
child = dict((t[0], t[1:]) for t in s)
print child
output of s = [((5, 4), 'South', 1), ((4, 5), 'West', 1)]
output of child = {(4, 5): ('West', 1), (5, 4): ('South', 1)}
Run Code Online (Sandbox Code Playgroud)
订单为何被改变?5,4应位于第一位置,(4,5)位于儿童字典的第2位.
我怎样才能为密钥增加1个值?
这里我的键是(5,4),它的值是南和1.现在我想让它的父节点也作为它的值,这样当我使用键[1]时 - 它shud给我南,1和父节点
因为"s"只包含两个东西,南部和1.因此它只生成密钥的2个值.我还需要1个.什么是命令?
totalCost = problem.getCostOfActions(self.actions)
Run Code Online (Sandbox Code Playgroud)