我一直试图让一个简单的双XOR神经网络工作,我遇到了反向传播训练一个非常简单的前馈神经网络的问题.
我一直在尝试遵循本指南来获得神经网络,但最多只能制作以极慢的速度学习的程序.
据我了解神经网络:
这是我目前正在努力工作的代码.我有很多其他的尝试有点混合,但我试图工作的主要反向传播功能是在Net.cpp的第293行
我有一个新安装的Ubuntu 18.04.3
系统(NVIDIA)只Qt SDK 5.12.5
,build-essential
,git
,和CMake
安装。我正在尝试通过在 Qt Creator 中打开主 CMakeLists.txt 来构建 Qt 项目:
Check for working CXX compiler: /usr/bin/g++
Check for working CXX compiler: /usr/bin/g++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at /home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
Failed to find "GL/gl.h" in "/usr/include/libdrm".
Call Stack (most recent call first):
/home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:174 (include)
/home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:89 (find_package)
CMakeLists.txt:89 (find_package) …
Run Code Online (Sandbox Code Playgroud) 我已经使用这些配置选项(Ubuntu 12.04)创建了Qt 5.2.0库的静态版本:
-opensource -confirm-license -force -pkg-config -release -static -prefix'/ home/juzzlin/qt5'-no-icu -opengl desktop -no-glib -accessibility -nomake examples -nomake tests -qt-zlib - qt-libpng -qt-libjpeg -qt-sql-sqlite -qt-xcb -qt-pcre -v
现在,问题是当我编译并链接我的应用程序对这些Qt库时,它尝试从Qt安装路径加载字体/home/juzzlin/qt5/lib/fonts
.这应该怎么样?该应用程序适用于我用来编译它的机器,但不适用于其他机器.我也不想将Qt东西安装到应用程序的某些系统目录中,因为应用程序不应该这样做.
这是我得到的错误:
QFontDatabase:找不到字体目录/ home/juzzlin/qt5/lib/fonts - 是否正确安装了Qt?
如何强制它在其他目录中搜索字体?
另一件我不明白的是,为什么我在使用MXE交叉编译Windows时没有遇到同样的问题?它在编译Qt库时使用几乎相同的配置选项.
我的简单Dockerfile:
FROM ubuntu:18.04
RUN apt update && apt upgrade -y
RUN apt install build-essential cmake qt5-default -y
RUN apt install qttools5-dev-tools -y
Run Code Online (Sandbox Code Playgroud)
当我检查linguist
容器内部时,它在那里:
root@9087245330a7:/# which linguist
/usr/bin/linguist
Run Code Online (Sandbox Code Playgroud)
...但是当我在容器中配置我的应用程序时:
CMake Error at CMakeLists.txt:72 (find_package):
By not providing "FindQt5LinguistTools.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"Qt5LinguistTools", but CMake did not find one.
Could not find a package configuration file provided by "Qt5LinguistTools"
(requested version 5.5.1) with any of the following names: …
Run Code Online (Sandbox Code Playgroud) 考虑如下代码:
#include <iostream>
#include <sstream>
int main()
{
std::stringstream ss;
ss << "a0 b1";
uint8_t byte;
ss >> std::hex >> byte;
std::cout << std::hex << byte << std::endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
为什么这个输出a
,而不是a0
即使a0
装配在uint8_t
十六进制?
我正在编写一个程序(仅用于学习目的,我想学习C++)在Qt框架中.是否可以将多少台显示器连接到我的计算机并使程序在不同的显示器上启动?我想在"属性"菜单中有一个选项,我可以告诉哪个监视器显示该程序.
我在Qt开发者维基中找不到任何东西,也许你们可以帮我提供关于如何做到这一点的文档?
谢谢
我在 Qt Creator 中创建了一个模板 QtQuick 项目(用于 CMake),它使用“官方”Qt SDK 在 IDE 中构建得很好。
然而,当尝试在 Ubuntu 20.04 中针对系统 Qt 构建 CLI 时,我得到:
$ mkdir build
$ cd build
$ cmake ..
-- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error …
Run Code Online (Sandbox Code Playgroud) 我的应用程序链接到一个自编译的 Qt,该 Qt 位于/usr/local/lib
.
当我在构建目录中启动应用程序时,这工作正常。但是,在我安装应用程序后,/usr/local/bin/
它尝试加载没有所需符号的不兼容系统 Qt 库并失败。
为什么?我的二进制文件的实际位置如何影响正在解析的 Qt?
如果我启动我的应用程序,LD_LIBRARY_PATH=/usr/local/lib
它就会按预期工作。
这段代码有什么问题:
static const std::vector<wchar_t> glyphs(
{L'A', L'B', L'C', L'D', L'E', L'F', L'G', L'H',
L'I', L'J', L'K', L'L', L'M', L'N', L'O', L'P',
L'Q', L'R', L'S', L'T', L'U', L'V', L'W', L'X',
L'Y', L'Z', L' ', L'Ä', L'Ö', L'Ü', L'Å', L' ',
L'a', L'b', L'c', L'd', L'e', L'f', L'g', L'h',
L'i', L'j', L'k', L'l', L'm', L'n', L'o', L'p',
L'q', L'r', L's', L't', L'u', L'v', L'w', L'x',
L'y', L'z', L' ', L'ä', L'ö', L'ü', L'å', L'\"',
L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', …
Run Code Online (Sandbox Code Playgroud) 我在Windows 10上安装了Qt 5.10 SDK.我认为HiDPI问题已在Qt 5.6中修复,但Qt Creator似乎仍然"太大":
我错过了什么吗?我的分辨率是3840x2160,"推荐"的150%缩放.后台的Visual Studio大小正确.