小编Ber*_*125的帖子

循环神经网络的实现

我正在尝试用 C 语言实现循环神经网络,但它不起作用。我在网上阅读了一些文档,但我不明白复杂的数学。所以我采用了多层感知器的计算。

在学习的几个步骤中,我的网络的输出是一个数字,但输出很快就变成“不是数字”(-1,#IND00)。

1.计算。

我的第一个问题是计算值、误差和重量变化。

N1->N2我通过以下方式计算两个神经元之间的前向链接:

  • 前向传球:(value of N2) += (value of N1) * (weight of link N1->N2)
  • 向后传递:(error of N1) += (error of N2) * (weight of link N1->N2)对于输出神经元(error) = (value of neuron) - (target output)
  • 体重变化:(new weight) = (old weight) - derivative(value of N2) * (error of N2) * (value of N1) * learning_rate

在每个神经元中,我存储在先前的前向和后向传递期间计算的神经元的先前值以及神经元的先前误差,因为在与前向链接相同的传递期间无法计算循环链接。

N2->N1通过以下方式计算两个神经元之间的循环链接:

  • 前向传递:(value of N1) += (previous value of N2) * (weight of link …

c neural-network recurrent-neural-network

5
推荐指数
1
解决办法
2394
查看次数

X11:使用xcb获取主窗口列表

我正在尝试获取已启动的 X 应用程序的主窗口列表,其中包含使用 xcb 库的 C 程序。根据这个问题,这些窗口似乎是“顶级窗口”:X11: list top level windows

所以我的程序要求 Openbox 窗口管理器提供这些窗口的列表,然后询问每个窗口的名称,但它不起作用。我正在使用 EWMH 原子,并且我读到 Openbox 符合 EWMH 标准。

编辑:当我运行控制台命令:时xprop -root _NET_CLIENT_LIST,它给出了几个窗口的标识符。所以看来 Openbox 支持这个原子。我看了下的代码xprop,不过是用Xlib写的,因为多线程支持所以需要使用xcb。

当我的程序从Openbox收到回复时,回复的长度为0。

这是源代码:

#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include <xcb/xcb.h>

xcb_atom_t getatom(xcb_connection_t* c, char *atom_name)
{
    xcb_intern_atom_cookie_t atom_cookie;
    xcb_atom_t atom;
    xcb_intern_atom_reply_t *rep;

    atom_cookie = xcb_intern_atom(c, 0, strlen(atom_name), atom_name);
    rep = xcb_intern_atom_reply(c, atom_cookie, NULL);
    if (NULL != rep)
    {
        atom = rep->atom;
        free(rep);
        printf("\natom: %ld",atom);
        fflush(stdout);
        return atom;
    } …
Run Code Online (Sandbox Code Playgroud)

x11 xcb

4
推荐指数
1
解决办法
2706
查看次数

标签 统计

c ×1

neural-network ×1

recurrent-neural-network ×1

x11 ×1

xcb ×1