- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在玩 AForge。我从 AForge 网站复制粘贴了示例。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AForge;
using AForge.Neuro;
using AForge.Math;
using AForge.Neuro.Learning;
namespace NeuralNetTest
{
class Program
{
static void Main(string[] args)
{
// initialize input and output values
double[][] input = new double[4][] {
new double[] {0, 0}, new double[] {0, 1},
new double[] {1, 0}, new double[] {1, 1}
};
double[][] output = new double[4][] {
new double[] {0}, new double[] {1},
new double[] {1}, new double[] {0}
};
Console.WriteLine("Tworzę sieć neuronową...");
// create neural network
ActivationNetwork network = new ActivationNetwork(
new SigmoidFunction(2),
2, // two inputs in the network
2, // two neurons in the first layer
1); // one neuron in the second layer
// create teacher
BackPropagationLearning teacher = new BackPropagationLearning(network);
Console.WriteLine("Sieć neuronowa uczy się...");
while (true)
{
double error = teacher.RunEpoch(input, output);
if (error < 0.001) break;
}
Console.WriteLine("Uczenie sieci neuronowej zakończone.");
Console.WriteLine("Sieć jest gotowa obliczać XOR.");
while (true)
{
Console.WriteLine("Wpisz pierwszy bajt: (0 lub 1):");
double f1 = (double)Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Wpisz drugi bajt: (0 lub 1):");
double f2 = (double)Convert.ToInt32(Console.ReadLine());
double[] netout = network.Compute(new double[2] { f1, f2 });
Console.WriteLine("{0} XOR {1} to {2}.", (int)f1, (int)f2, netout[0]);
Console.ReadLine();
}
}
}
}
如您所见,它应该能够计算两位的异或。然而。它卡住了学习!它工作正常,但现在每次错误为 0.26981832999407546 时它都会卡住。
它正在工作。而现在,砰的一声,它不起作用,到底是什么?提前致谢。
最佳答案
可能收敛失败,可以将默认值为0.1的学习率teacher.LearningRate
调小一些。
另外请注意,您的程序在学习过程中卡住,因为这需要时间,您可以在另一个单独的线程上运行训练。
我有一个很好的使用 AForge.NET 和 Accord.NET 的演示,拿一个 look .
关于C# AForge,程序卡在学习阶段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12880629/
我目前正在做一个“自动车牌检测和识别”,我正在使用 AForge.Net;我使用了一个简单的算法; 虽然它不是很有效,但它会满足我的要求。我已经计算出高度、宽度和高度与宽度(高度/宽度)的比率超过40
我的 WinForms .NET 4 C# 应用程序在用户与其交互时记录桌面。 它根据系统的速度使用 AForge FFMPEG 或 VFW 包装器。当然,捕获是在后台线程中完成的。 无论哪种情况,包
我已经编写了一些需要处理大约 3000 张图像的 C# 代码,但是到第 500 张图像时,任务管理器显示该程序使用了 1.5GB 的内存。下面的功能似乎是罪魁祸首之一。我可以在这里做得更好吗?任何帮助
我正在使用 Aforge .NET 框架在我的应用程序中获取网络摄像头,但我总是得到一个全灰色的图像框架。 this.videoSource = new VideoCaptur
我正在玩 AForge。我从 AForge 网站复制粘贴了示例。 using System; using System.Collections.Generic; using System.Linq;
我正在尝试在 Unity 中使用 AForge,但在转换输入数据时遇到了问题。我有一个二维数组,用于存储需要转换为 UnmanagedImage 的像素值。我想出了以下代码,但我不确定它是否是最有效的
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 8 年前。 Improve this qu
我正在尝试学习 Aforge.net。我写了 o 代码,它工作正常,但我只想在我的图像上检测到紫色,但我找不到它是怎么回事。所以任何人都可以帮助我吗?这是我的代码 Bitmap resim = new
有人可以给我一个完整的例子,使用这个用 VB.NET 或 C# 编写的库在 picturebox 中显示流的图像 最佳答案 这是一个非常非常简单的表单,它使用了 AForge.Video.MJPEGS
如何使用此方法: public static void DFT (Complex[] data, Direction direction) 如果我的输入数组是short[] samples?我可以轻松
我正在尝试使用 Aforge.net 开发一个 LPR 系统,我想在我的图像上应用一个过滤器,正如您在此处看到的: Bitmap a = new Bitmap(@"C:\Use
我需要一些帮助将视频从笔记本电脑相机保存到文件。现在我使用代码来搜索图片框上的视频设备和以前的视频。 我试过 AVIFileWrite 但我失败了。 如何使用 VideoFileWriter 来实现我
我正在尝试从视频文件中提取特定帧。当我使用 aforge 库播放视频文件时,我有一个想要的帧。我调用了一个新帧事件,如果新帧与我的特定帧匹配,那么它会显示一条消息:“帧匹配”。此特定帧随机出现在视频文
我尝试使用 AForge 在 C# 中使用 IP 摄像机做一个录制功能,但我无法真正理解编码,因为我是一个新学习者。录制的视频将保存在我的电脑中。 据我所知,此功能是编写/创建视频并将其保存在我的存储
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我正在尝试检测这张图片上的矩形: 使用此代码: static void Main(string[] args) { // Open your image string path = "
我正在使用 AForge 进行运动检测,并且我知道可以设置运动区域。是否可以让它仅在所有定义区域中有运动时触发?如果上面的功能不是现成的,我正在考虑编写它。 目前,我的理解是区域设置为视觉库中 Mot
我需要在图像上查找对象,因此我尝试使用 AForge 库来完成。我从非常简单的图案和图片开始,但识别准确度已经很糟糕了。我正在使用 ExhaustiveTemplateMatching: Exhaus
如何检测视频中的非移动 Blob ? 假设我有一个视频和一个初始背景帧位图。是否有可能检测到不移动的 Blob /对象?并围绕该对象绘制一个矩形? 最佳答案 这让我想起了一种检测地铁上遗忘元素的算法。
我正在尝试在 AForge 中检测矩形内的圆。我已成功确定 Rectangles,但无法在 Rectangle 中找到 circles。如何在 AForge 中找到另一个形状内的形状。 string
我是一名优秀的程序员,十分优秀!