微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

不麻木的基本神经网络->了解迭代步骤

如何解决不麻木的基本神经网络->了解迭代步骤

我试图可视化以下神经网络代码正在执行的步骤。这是绝对的基础,甚至不使用Numpy也能直观地看到并意识到代码中正在发生的事情:

这是到目前为止的注释代码

weights = ([0.1,0.1,-0.3],#first matrix weight´s
           [0.1,0.2,0.0],[0.0,1.3,0.1])

info1 = [8.5,9.5,9.9,9.0]     #second matrix info´s
info2 = [0.65,0.8,0.9]
info3 = [1.2,0.5,1.0]

input = [info1[0],info2[0],info3[0]]

def w_sum(a,b):              #(weighted) sum function
    assert(len(a) == len(b))
    output = 0
    for i in range(len(a)):
        output += (a[i] * b[i])
    return output

def vect_mat_mul(vect,matrix):        #dot product function
    assert(len(vect) == len(matrix))
    output = [0,0]
    
    for i in range (len(vect)):
        output[i] = w_sum(vect,matrix[i])  # updates the output = [0,0] list with the 
                                            # result of w_sum(a,b) on position [i]
                                            # every iteration step i
    return output

def neural_network(input,weights):    #inputting the start values into the network
    pred = vect_mat_mul(input,weights)
    return pred

pred = neural_network(input,weights)  #calling the network --> the variable
                                       # 'output = [0,0] is Now updated with the
                                       # values from the dot product
                                       # and 'transported outwards' by assigning the return of the network to "pred"

print(pred)

在这里,我试图可视化正在发生的事情:

代码正在执行的第一个“迭代”步骤

The first "iteration" step the code is executing

代码正在执行的第二个“迭代”步骤

The second "iteration" step the code is executing

代码正在执行的第三个“迭代”步骤

The third "iteration" step the code executes

因此,最后是典型的神经网络图,其中包含所有步骤及其链接

all the three steps

现在我的问题是:正确吗?就像Python真的真的通过这两个函数在第三个函数(网络函数)中连接并正确链接到3 x 3矩阵点积的循环遍历for循环一样吗?

一开始就是魔术吗?

问题:

  1. 下一步将是什么?

  2. 如何遍历info1,info2和info3列表的输入值?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?