forward pass和backpropagation

博客提及了前向传播(forward pass)和反向传播(backpropagation),这两者是神经网络中的重要概念,前向传播用于计算输出,反向传播用于更新网络参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. forward pass

在这里插入图片描述
2. backpropagation
在这里插入图片描述

### Forward-Forward Algorithm in Machine Learning The Forward-Forward (FF) algorithm represents an innovative approach within machine learning that diverges from traditional backpropagation methods used primarily in training neural networks. Unlike conventional models where information moves forward during prediction and backward for error propagation, FF operates differently by focusing solely on forward passes. In the context of supervised learning scenarios described previously[^1], typical algorithms require labeled data pairs \((x,y)\). However, the FF model can operate effectively even without explicit labels, making it more versatile across various applications including unsupervised settings. The core idea behind FF involves running two consecutive forward passes: Firstly, one pass uses real input samples aiming at activating neurons relevant to actual features present in those inputs; Secondly, another artificial "negative" sample is generated either randomly or based on certain rules designed specifically not resembling any true instance closely enough so as to deactivate these same units activated earlier – thus contrasting between positive (realistic) versus negative (artificial). This mechanism allows self-supervision since no external supervision signal such as target outputs \(y\) needs providing explicitly beyond initial setup stages if necessary at all. Through repeated iterations over datasets while adjusting weights according only differences observed post each pair-wise comparison round-trip operations performed above until convergence criteria met signifying optimal parameter configurations achieved. ```python def forward_forward_pass(model, real_sample, fake_sample): # First forward pass with real sample output_real = model.forward(real_sample) # Second forward pass with artificially created 'fake' sample output_fake = model.forward(fake_sample) # Adjusting parameters based on difference observed loss = compute_loss(output_real, output_fake) update_weights(loss) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值