Jack Huang's Blog


  • 首页

  • 标签

  • 归档

  • 搜索

空战战术集锦

发表于 2021-08-06 | 更新于 2021-08-17

参考链接

  1. 超视距空战初探,by 殇璃魂.
  2. 战争雷霆空战入门进阶教程 空战机动战术详解【1】,by 大眼小乌贼.
  3. 超视距空战的发展及其局限性,by 新浪军事.
  4. 击剑云端——现代超视距空战基本动作详解,by 万年炎帝.
  5. 不懂这些基本的战机作战技能,别说你是空战迷!,by 军武.

科技论文写作技巧

发表于 2021-08-04 | 更新于 2022-03-29

科技论文文本结构通常由标题、作者、摘要、关键词、引言、方法、结果、讨论、结论等部分组成。下面总结记录各部分写作方法。

参考文献

  1. 科技论文,by 百度百科.
  2. 科技论文的引言怎么写 ,by PaperPP论文查重.
  3. 论文中Conclusion写作的几大要点,附有实例指导、写作模板,by 美辑编译.
  4. 科技论文的结论如何写作?,by 第2导师.
  5. 编辑视角下,论文摘要、引言、结论怎么写?,by qq.

Windows下OsgEarth编译安装过程

发表于 2021-07-28 | 更新于 2022-07-25

记录Windows下osgEarth编译安装过程。

安装vcpkg

首先,请下载vcpkg并执行 bootstrap.bat 脚本。

1
2
> git clone https://github.com/microsoft/vcpkg
> .\vcpkg\bootstrap-vcpkg.bat

使用以下命令安装您的项目所需要的库:

1
> .\vcpkg\vcpkg install [packages to install]

您也可以使用 search 子命令来查找vcpkg中集成的库:

1
> .\vcpkg\vcpkg search [search term]

若您希望在 Visual Studio 中使用vcpkg,请运行以下命令 (首次启动需要管理员权限)

1
> .\vcpkg\vcpkg integrate install

若您希望在 Visual Studio 中卸载vcpkg,请运行以下命令 (首次启动需要管理员权限)

1
> .\vcpkg\vcpkg integrate remove

卸载vcpkg只需删除vcpkg的文件夹即可。

使用vcpkg安装osgEarth

使用如下命令安装osgEarth:

1
vcpkg install osgearth:x64-windows

经验证,使用vs2015编译安装osgEarth的依赖项blend2d失败,因blend2d不支持vs2015编译器。因此只能自己编译安装osgearth。

编译前准备

使用vcpkg安装osg、gdal、curl。

1
vcpkg install osg:x64-windows gdal:x64-windows curl:x64-windows。

编译安装osgEarth

使用cmake编译安装osgEarth。

1
2
3
4
5
6
cd I:\project
git clone https://github.com/gwaldron/osgearth.git
cd osgearth
mkdir build
cmake -S . -B build -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWIN32_USE_MP=ON -DCMAKE_INSTALL_PREFIX=I:\project\osgearth\install -DCMAKE_TOOLCHAIN_FILE=I:\project\vcpkg\scripts\buildsystems\vcpkg.cmake
cmake --build build --target INSTALL --config RelWithDebInfo

设置运行时环境

1
2
3
set PATH=%PATH%;c:\vcpkg\installed\x64-windows\bin
set PATH=%PATH%;c:\vcpkg\installed\x64-windows\tools\osg
set PATH=%PATH%;[installroot]

参考链接

  1. osgearth编译全过程,by jianingshow.
  2. Building osgEarth,by osgEarth.
  3. Windows下QT与OSG开发环境配置,by jackhuang.
  4. 安装GDAL配置到VS2017的艰难之路(避坑之作),by Icesrteam.
  5. VS2017编译GDAL常见问题,by 一个渣渣的世界.
  6. 使用OSGeo4W安装配置QGIS,by Test_hh112.
  7. windows10 环境中安装GDAL及其python绑定,by 蔚蓝小栈.
  8. [工具]包管理工具Vcpkg 的使用,by 南象.
  9. 如何看待 Windows 的 C++ 包管理器 vcpkg?,by zhihu.
  10. win10 + vs2017 + vcpkg —— VC++ 打包工具,by 一花一世界,一叶一乾坤.
  11. osgEarth基础入门,by sunliming.
  12. Visual Studio工具 vcpkg簡介,by itread01.
  13. How to remove vcpkg and all libraries installed with vcpkg,by stackoverflow.
  14. Visual Studio开源库集成器Vcpkg全教程–利用Vcpkg轻松集成开源第三方库,by 明卿.
  15. Build failed with vs2015,by blend2d.
  16. Build Instructions for blend2d,by blend2d.
  17. window10系统中,vcpkg使用到opengl(编译MVG)库时提示Error: Building package * failed with: BUILD_FAILED,by 知识在于分享.
  18. OsgEarth 2.x升级到3.1注意事项,by 孙高勇.

expressjs的PayloadTooLargeError错误的解决办法

发表于 2021-07-08 | 更新于 2022-07-23

本文介绍Nodejs的Expressjs服务器出现PayloadTooLargeError错误的解决办法。

问题表现

当使用HTTP Put方法携带大量数据时前端会触发超时错误。

问题分析

在app.js中建立并使用应用级别的中间件函数,用于捕捉PayloadTooLargeError错误。

1
2
3
4
app.use(function (req, res, next) {
console.log(req)
next()
})

问题解决

nodejs 做为服务器,在传输内容或者上传文件时,系统默认大小为100kb,这时,我们需要修改系统限制。我们在app.js中调用接口和对应方法中,加入对应参数即可:

1
2
3
4
5
6
7
8
var bodyParser = require('body-parser');
app.use(bodyParser.json({
limit: '50mb' //nodejs 做为服务器,在传输内容或者上传文件时,系统默认大小为100kb,改为50M
}));
app.use(bodyParser.urlencoded({
limit: '50mb', //nodejs 做为服务器,在传输内容或者上传文件时,系统默认大小为100kb,改为50M
extended: true
}));

参考链接

  1. nodejs 做为服务器:PayloadTooLargeError: request entity too large when trying to POST into SQL, by IT博客技术分享.
  2. 【记录】form-data与x-www-form-urlencoded的区别,by -天道酬勤-.

pytorch学习笔记

发表于 2021-06-17

PyTorch 是基于以下两个目的而打造的python科学计算框架:

  • 无缝替换NumPy,并且通过利用GPU的算力来实现神经网络的加速。
  • 通过自动微分机制,来让神经网络的实现变得更加容易。

参考链接

  1. pytorch教程之nn.Module类详解——使用Module类来自定义模型,by LoveMIss-Y.
  2. PyTorch 中文教程,by apachecn.
  3. torch.distributions 详解,by Vic_Hao.
  4. What does log_prob do?,by stackoverflow.
  5. VAE中的重参数化技巧-reparameterization trick,by Weibo Mao.

重要性采样与重参数理解

发表于 2021-06-16

重要性采样与重参数是深度强化学习算法中常用的统计学技巧,比较难理解,遂将一些解读记录如下。

重要性采样

重参数

利用行为策略产生的数据评估目标策略需要利用重要性采样方法。

参考链接

  1. 漫谈重参数:从正态分布到Gumbel Softmax,by 苏剑林.
  2. 重要性采样(Importance Sampling)详细学习笔记,by hehedadaq.
  3. PR Sampling Ⅰ: 蒙特卡洛采样、重要性采样及python实现,by 刘浚嘉.

gym使用帮助

发表于 2021-06-13 | 更新于 2021-06-19

Gym 是一个用于开发和比较强化学习算法的工具包。 它支持从步行到玩 Pong 或 Pinball 等游戏的代理的训练工作。

安装

从库安装:

1
pip install gym

从源安装:

1
2
3
git clone https://github.com/openai/gym
cd gym
pip install -e .

环境

1
2
3
4
5
6
7
import gym
env = gym.make('CartPole-v0')
env.reset()
for _ in range(1000):
env.render()
env.step(env.action_space.sample()) # take a random action
env.close()

参考链接

  1. gym doc,by openai.
  2. OpenAI Gym 经典控制环境介绍——CartPole(倒立摆,by 思绪无限.
  3. Beginner’s Guide to Custom Environments in OpenAI’s Gym,by Mate Pocs.
  4. Solving OpenAI Gym Environments with MATLAB RL Toolbox,by Paulo Carvalho.

Win10安装Linux子系统

发表于 2021-06-07 | 更新于 2021-12-10

OpenAI的Spinning Up项目仅在 Linux 和 OSX 上支持Spinning Up,因此想在Win10系统中安装Linux子系统,以便将Spinning Up项目运行起来,学习一下强化学习。

安装Linux子系统

步骤如下:

  1. 打开控制面板,选择应用,点击左上角的程序和功能,在弹出窗口中点击启动或关闭Windows功能,勾选适用Linux的Windows子系统。
  2. 打开Store商店,安装Ubuntu 20.04操作系统。

配置Spinning Up项目

步骤如下:

  • 打开cmd,输入wsl命令,进入ubuntu系统。
  • 下载并安装Xming。
  • 使用如下命令安装x11-apps。
1
2
3
sudo apt-get install x11-apps
export DISPLAY=localhost:0.0
nano ~/.bashrc #(add export DISPLAY=localhost:0.0 at the end. Ctrl+X to exit/save)
  • 下载并安装miniconda。
  • 创建Python虚拟环境。
1
2
3
4
5
6
# 创建虚拟环境
conda create -n spinningup python=3.7
# 查看虚拟环境
conda info -h
# 删除创建的虚拟环境
conda remove -n spinningup --all
  • 激活Python虚拟环境。
1
conda activate spinningup
  • 反激活Python虚拟环境。
1
conda deactivate
  • 安装openmpi组件
1
sudo apt-get update && sudo apt-get install libopenmpi-dev
  • 安装opengl组件
1
sudo apt-get install python-opengl
  • 下载Spinning Up项目
1
2
3
git clone https://github.com/openai/spinningup.git
cd spinningup
pip install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple
  • 测试项目
1
2
3
4
5
6
# 运行登陆器
python -m spinup.run ppo --hid "[32,32]" --env LunarLander-v2 --exp_name installtest --gamma 0.999
# 绘图
python -m spinup.run plot /mnt/i/project/spinningup/data/installtest/installtest_s0
# 视频
python -m spinup.run test_policy /mnt/i/project/spinningup/data/installtest/installtest_s0

参考链接

  1. WSL Linux 子系统,真香!附完整实操,by 猴哥一一.
  2. 在 Windows 10 中使用 OpenAI Spinning Up ,by csu.
  3. Anaconda创建环境、删除环境、环境重命名,by CodeAntenna.
  4. [Bug Report] contextlib has no attribute ‘nullcontext’ for Python3.6 when calling register(),by github.

深度强化学习的实验环境汇总

发表于 2021-06-07

参考链接

  1. 深度强化学习中实验环境-开源平台框架汇总,by 小小何先生.
  2. 强化学习实验环境 I (MuJoCo, OpenAI Gym, rllab, DeepMind Lab, TORCS, PySC2),by AITBOOK.

FlightGear多屏多视口设置方法

发表于 2021-06-03 | 更新于 2021-06-23

在玩FlightGear的过程中,可能需要将视景分角度投影到不同显示器上,或者在一个显示器窗口上投影不同角度的视景。下面记录该需求实现方法。

投影到不同显示器

在FGDATA文件夹根目录下创建camera-views.xml文件夹,写入如下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0"?>
<PropertyList>
<camera-group>
<window>
<name type="string">Front</name>
<host-name type="string"></host-name>
<display>0</display>
<screen>0</screen>
<fullscreen type = "bool">false</fullscreen>
<decoration type = "bool">false</decoration>
<x>0</x>
<y>0</y>
<width>1920</width>
<height>1080</height>
</window>

<window>
<name type="string">Right</name>
<host-name type="string"></host-name>
<display>0</display>
<screen>1</screen>
<fullscreen type = "bool">false</fullscreen>
<decoration type = "bool">false</decoration>
<x>0</x>
<y>0</y>
<width>1280</width>
<height>720</height>
</window>

<gui>
<window>
<name type="string">Front</name>
</window>
</gui>

<camera>
<name type="string">Front</name>
<window>
<name>Front</name>
</window>

<view>
<heading-deg type = "double">0.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>0</x>
<y>0</y>
<width>1920</width>
<height>1080</height>
</viewport>

</camera>
<camera>
<name type="string">Right</name>
<window>
<name>Right</name>
</window>

<view>
<heading-deg type = "double">-45.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>0</x>
<y>0</y>
<width>1280</width>
<height>720</height>
</viewport>

</camera>
</camera-group>
</PropertyList>

在FGDATA文件夹根目录下找到defaults.xml配置文件,修改如下配置内容,加入camera-views.xml配置文件。

1
2
<rendering include="camera-views.xml">
</rendering>

投影到窗口不同地方

在FGDATA文件夹根目录下创建camera-views.xml文件夹,写入如下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?xml version="1.0"?>
<PropertyList>
<camera-group>
<window>
<name type="string">Front</name>
<host-name type="string"></host-name>
<display>0</display>
<screen>0</screen>
<fullscreen type = "bool">false</fullscreen>
<decoration type = "bool">false</decoration>
<x>0</x>
<y>0</y>
<width>1920</width>
<height>1080</height>
</window>

<gui>
<window>
<name type="string">Front</name>
</window>
</gui>

<camera>
<name type="string">Main</name>
<window>
<name>Front</name>
</window>

<view>
<heading-deg type = "double">0.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>0</x>
<y>0</y>
<width>1920</width>
<height>1080</height>
</viewport>

</camera>
<camera>
<name type="string">Left-Down</name>
<window>
<name>Front</name>
</window>

<view>
<heading-deg type = "double">0.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>0</x>
<y>0</y>
<width>320</width>
<height>180</height>
</viewport>

</camera>
<camera>
<name type="string">Right-Down</name>
<window>
<name>Front</name>
</window>

<view>
<heading-deg type = "double">0.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>1600</x>
<y>0</y>
<width>320</width>
<height>180</height>
</viewport>

</camera>
<camera>
<name type="string">Right-Up</name>
<window>
<name>Front</name>
</window>

<view>
<heading-deg type = "double">0.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>1600</x>
<y>900</y>
<width>320</width>
<height>180</height>
</viewport>

</camera>
</camera-group>
</PropertyList>

在FGDATA文件夹根目录下找到defaults.xml配置文件,修改如下配置内容,加入camera-views.xml配置文件。

1
2
<rendering include="camera-views.xml">
</rendering>

参考链接

  1. Multi-Display setup,by flightgear.
  2. Howto:Configure camera view windows,by flightgear.
上一页1…222324…53下一页

Jack Huang

528 日志
68 标签
© 2025 Jack Huang
由 Hexo 强力驱动
|
主题 — NexT.Muse