在ubuntu上编译prometheus

prometheus从0编译/安装与运行(2.45.3版本举例) 【代码】prometheus从0编译/安装与运行(2.45.3版本举例) 阅读详情

prometheus的编译并不难,核心是要将编译环境配置到符合要求的地步,否则就会出现各种错误,而且难以排查。
我们主要需要关心go、npm和nodejs的版本。
以下步骤亲测有效。

系统环境

使用下面指令升级软件(非必要)

sudo apt update
sudo apt upgrade

升级过后我的系统环境信息如下

cat /proc/version

Linux version 5.15.0-101-generic (buildd@lcy02-amd64-031) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #111~20.04.1-Ubuntu SMP Mon Mar 11 15:44:43 UTC 2024

这一步主要是为了展现我的实验环境。

编译环境

安装各种代码拉取和编译过程中的工具

sudo apt install git
sudo snap install go --classic
sudo apt install nodejs
sudo apt install npm

默认的版本

Golang

go version

go version go1.22.1 linux/amd64

Nodejs

node --version

v10.19.0

NPM

npm version

{ npm: ‘6.14.4’,
ares: ‘1.15.0’,
brotli: ‘1.0.7’,
cldr: ‘36.1’,
http_parser: ‘2.9.3’,
icu: ‘66.1’,
modules: ‘64’,
napi: ‘5’,
nghttp2: ‘1.40.0’,
node: ‘10.19.0’,
openssl: ‘1.1.1f’,
tz: ‘2024a’,
unicode: ‘13.0’,
uv: ‘1.34.2’,
v8: ‘6.8.275.32-node.55’,
zlib: ‘1.2.11’ }

更新Nodejs和NPM

上述nodejs和npm的版本比较老,需要我们手动升级它们。

sudo npm install -g n
sudo n lts
sudo n prune

重启终端,执行下面指令

npm install -g npm@latest

Nodejs

node --version

v20.12.0

NPM

npm version

{
npm: ‘10.5.0’,
node: ‘20.12.0’,
acorn: ‘8.11.3’,
ada: ‘2.7.6’,
ares: ‘1.27.0’,
base64: ‘0.5.2’,
brotli: ‘1.1.0’,
cjs_module_lexer: ‘1.2.2’,
cldr: ‘44.1’,
icu: ‘74.2’,
llhttp: ‘8.1.1’,
modules: ‘115’,
napi: ‘9’,
nghttp2: ‘1.60.0’,
nghttp3: ‘0.7.0’,
ngtcp2: ‘0.8.1’,
openssl: ‘3.0.13+quic’,
simdutf: ‘4.0.8’,
tz: ‘2024a’,
undici: ‘5.28.3’,
unicode: ‘15.1’,
uv: ‘1.46.0’,
uvwasi: ‘0.0.20’,
v8: ‘11.3.244.8-node.19’,
zlib: ‘1.3.0.1-motley-40e35a7’
}

编译

git clone https://github.com/prometheus/prometheus.git
cd prometheus
make build

编译过程比较漫长,需要耐心等待。

运行

./prometheus --config.file=./documentation/examples/prometheus.yml 

在浏览器中打开http://localhost:9090
可以看到页面如下,说明编译和运行没有问题。
在这里插入图片描述

Prometheus 无人机仿真平台 Ubuntu 18.04 部署:3个关键编译报错与解决方案 本文详细解析了在Ubuntu 18.04系统上部署Prometheus无人机仿真平台时遇到的3个关键编译报错及其解决方案,包括CMake版本冲突、子模块下载失败和权限问题。通过深入分析问题根源并提供已验证的修复方法,帮助开发者快速搭建稳定的无人机仿真环境,提升开发效率。 阅读详情

相关推荐

Ubuntu 16.04下OpenResty源码编译与生产级部署指南

OpenResty是以Nginx为运行时、Lua为编程语言的可编程Web平台,其核心价值在于将业务逻辑(如JWT鉴权、限流、动态路由)直接嵌入HTTP请求生命周期,避免微服务间冗余调用。它依托Nginx事件驱动模型与LuaJIT即时编译实现零序列化、低延迟处理,显著优于传统网关架构。在Ubuntu 16.04等长期支持系统上,需规避官方apt源陈旧包(如1.9.7.4版缺失SSL模块),转而采用兼容性验证充分的源码编译方案(如1.13.6.2),精准启用http_ssl_module、stream、http

weixin_33716154的博客 452

prometheus编译安装

prometheus是搜集应用程序所使用的CPU 内存 以及磁盘使用大小的神器, 它可以根据用户所配置的性能阀值给出相应的处理,比如 邮件告警等,在这里就不啰嗦了,由于本人也是刚刚学习 所以能说的也就这么多. 一.代码编译: 1.克隆代码 git clone https://github.com/prometheus/prometheus.git 2.代码编译,很简单,因为官方提供了M...

纵横四海的博客 3786

OnlyOffice 源码编译实战:Ubuntu 20.04 Docker 环境 3 小时构建与连接数破解

本文详细介绍了在Ubuntu 20.04 Docker环境中高效编译OnlyOffice源码的实战指南,包括环境配置、Dockerfile优化、源码编译流程及连接数限制解除方案。通过容器化部署和性能调优,显著提升构建效率,适用于企业级文档协作系统的定制化部署。

weixin_32705179的博客 243

Prometheus源码学习(1) 编译源码

代码里面看不明白的变量或者函数可以通过两种方式观测它的值来了解其含义 一种是把代码片段摘出来,写到一个测试程序里运行一下 另一种时日志里打印它的值来观察 第一种比较简单易行,但是代码片段要比较独立才好做,第二种要修改源码重新编译,可以在整个源码上下文中观测,但是需要编码源码,相对麻烦一些,研究源码早晚也要编译,所以先总结一下编译 Prometheus 源码的步骤。 编译 Prometheus 源码需要 node.js 和 yarn。我是在 WSL2 上编译的。 安装 node.js $ curl -

qq_35753140的博客 1075

Ubuntu下Net-SNMP 5.9.3编译安装全攻略(附常见错误解决方案)

本文详细介绍了在Ubuntu系统下编译安装Net-SNMP 5.9.3的全过程,包括环境准备、依赖处理、源码编译、系统集成等关键步骤,并提供了常见错误解决方案。特别针对netsnmp编译过程中可能遇到的依赖冲突、权限配置等问题给出了实用建议,帮助用户顺利完成部署并优化性能。

weixin_29210727的博客 389

保姆级教程:在Ubuntu 16.04上编译安装Omni Core节点(含BerkeleyDB 4.8避坑指南)

本文提供在Ubuntu 16.04上编译安装Omni Core节点的详细教程,特别包含BerkeleyDB 4.8的避坑指南。Omni Core节点是连接Omni Layer协议与区块链网络的关键组件,支持USDT等资产的链上交易验证,适合去中心化金融应用。教程涵盖环境配置、依赖管理、源码编译、节点优化及安全加固等全流程。

weixin_30352645的博客 463

prometheus-2.37.0监控平台编译部署

Prometheus 开源的系统监控和服务监控 AlertManager 告警插件 Node_Exporter 用来监控各节点的资源信息的插件 grafana 展示面板

XMYX-0 2565

告别Docker!在Ubuntu 22.04上手动编译部署Weaviate v1.24.0的完整踩坑记录

本文详细介绍了在Ubuntu 22.04上手动编译部署Weaviate v1.24.0向量数据库的完整流程,包括环境准备、Go环境配置、源码编译、向量模块集成、系统服务化及安全加固等关键步骤,特别适合需要绕过Docker的生产环境部署需求。

weixin_30369041的博客 329

prometheusalert源码编译arm64

项目需求服务基于arm64服务器centos系统组件一套prometheus监控系统,目前prometheus、alertmanager均可通过官网获取arm64安装包、prometheusalert官网只有x86-64或者源码,现记录一下本次编译过程一起学习。

know_xiao的博客 674

保姆级教程:在Ubuntu 22.04上从源码编译部署WVP-Pro+ZLMediaKit国标平台

本文提供在Ubuntu 22.04上从源码编译部署WVP-Pro+ZLMediaKit国标平台的详细指南,涵盖环境准备、组件配置、联调优化及安全加固等关键步骤。通过深度整合WVP-Pro和ZLMediaKit,帮助用户快速搭建符合GB28181标准的企业级视频监控管理系统,解决常见部署问题并提升平台性能。

weixin_28475533的博客 369

PCI-Express、MiniPCIe、ExpressCard接口转换说明/引脚互换关系

通过引脚PIN互换可以在PCI-Express、MiniPCIe、ExpressCard之间切换不同的接口;提供接口引脚表和标准尺寸图。

tech34的博客 7128

阿木实验室 ubuntu 20.04 Prometheus 系统 编译问题

1. ./compile_detection.sh error: make[2]: *** [CMakeFiles/darknet_ros_lib.dir/build.make:2017:CMakeFiles/darknet_ros_lib.dir/src/darknet_ros/src/YoloObjectDetector.cpp.o] 错误 1 make[1]: *** [CMakeFiles/Makefile2:946:CMakeFiles/darknet_ros_lib.dir/all] 错误

Sherry__C的博客 6038

科研人必备!用WisPaper搭建个人文献知识库的完整指南(附Zotero联动技巧)

本文详细介绍了如何利用WisPaper搭建高效的个人文献知识库,包括文件命名标准化、文件夹结构设计、语义搜索技巧及与Zotero的深度联动方法。通过智能标签系统和知识图谱功能,科研人员可以快速定位关键文献,提升研究效率。特别适合需要管理大量学术文献的研究者。

weixin_30823001的博客 268

prometheus_px4配置

prometheus_px4是Prometheus项目配套使用的PX4固件,Prometheus项目的仿真模块依赖以及ros功能包。这是阿木实验室推出的无人机仿真工具,最近在想用Prometheus做仿真,所以先安装了prometheus_px4,出了点报错,所以我分享出来,希望对大家有帮助。我的电脑系统是ubuntu20.04。已经提前安装过ROS了。后续会把Prometheus如何配置分享给大家。这是官网的手册。我是按照手册里配置的。

qq_53015543的博客 889

【学习笔记】人群归因分数 PAF 以及combined PAF

人群归因风险比例(Population Attributable Fraction,PAF)是一个流行病学指标,它估计了在总体中,如果能消除一个特定的危险因素,能预防多少百分比的疾病或健康结果。简单来说,PAF回答的是:“如果没有这个风险因素,总体中会有多少病例是可以避免的?

weixin_53499537的博客 4906

基于Spring Boot框架的网上蛋糕销售系统

随着互联网的普及和电子商务的迅猛发展,网上购物已经成为人们日常生活的一部分。蛋糕作为一种受欢迎的食品,其销售市场也逐渐向网络化方向发展。网上蛋糕销售系统能够打破时间和地域的限制,让消费者随时随地浏览和购买蛋糕,同时也为蛋糕商家提供了一个展示和销售产品的平台。该系统的开发旨在提高蛋糕预定和销售的便捷性,节约时间和经济成本,并推动蛋糕市场的进一步发展。开发语言:Java,一种面向对象的编程语言,具有跨平台性、稳定性和安全性等特点,适用于构建大型、复杂的Web应用程序。 框架:Spring Boot,一个基于Sp

2301_81127431的博客 997

Prometheus 环境搭建

Prometheus

darren_pty 1914

OpenClaw实战四|内容创作全流程AI助理:自动撰稿+智能剪辑+多平台发布,一人顶一个内容团队

AI替代的是「写稿、剪辑、发布」这种流水线工作,真正让你解放出来,去做选题、创意、人设、变现这些高价值的事。OpenClaw这套内容创作全流程AI助理,最大的价值不是「帮你发内容」,而是让一个人,拥有一个内容团队的产能。不管是个人博主、小团队,还是企业新媒体,都能用零代码的方式,快速搭建属于自己的自动化内容矩阵。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 593

prometheus s6720 系列交换机监控

为毛用Prometheus监控,要问,老板要求用的,哈哈 一、ubuntu 和 centos 都是一样的 部署好环境 # Debian-based distributions. sudo apt-get install unzip build-essential libsnmp-dev p7zip-full # Redhat-based distributions. sudo yum install gcc gcc-g++ make net-snmp net-snmp-utils net-snmp-

tc_frank的专栏 1439

PyTorch实战(2)——使用PyTorch构建神经网络

在本节中,我们使用 PyTorch 在简单数据集上构建了一个神经网络,训练神经网络来映射输入和输出,并通过执行反向传播来更新权重值以最小化损失值,并利用 Sequential 类简化网络构建过程;介绍了获取网络中间值的常用方法,以及如何使用 save、load 方法保存和加载模型,以避免再次训练模型。

盼小辉丶的博客 1万+

DSP篇--C6678功能调试系列之SPI调试

SPI传输数据分为线上直接收发和通过EDMA的数据传输两种。第一种是直接将数据放在线上(SPIDAT1),在寄存器(SPIBUF)中写入命令实现数据的收发;第二种需要配置EDMA,将数据buffer直接作为EDMA的数据源进行传输,其需要配置的参数和中断与EDMA一致。

nanke_yh的博客 1261

prometheus 无人机平台 gazeboORBSLAM3调试实现rgbd模式

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 目录 前言 一、镜像系统安装 二、prometheus镜像快速使用 1.prometheus_px4,Prometheus编译 2.下载并编译ORBSLAM3 3.在工作空间下编译ORBSLAM3 总结 前言 基于18.04的阿木实验室镜像系统,双系统非虚拟机 一、镜像系统安装 参考阿木实验室官方文档 二、prometheus镜像快速使用 1.prometheus_px4,Prometheus编译 编.

Sherry__C的博客 1023

当SLAM遇上FPGA:打造一个会“硬件加速”的激光雷达SLAM系统

点云数据的运动畸变校正特征点提取与匹配、以及ICP迭代最近点配准。在传统方案中,我们通常用ARM核完成所有计算。但点云配准中的最近邻搜索(KD-Tree)需要大量分支判断,CPU处理起来效率很低;而ICP中的矩阵分解(SVD)虽然计算量大,但非常适合并行化。ZYNQ的特殊之处在于它把ARM(PS端)和FPGA(PL端)集成在同一颗芯片上。ARM擅长跑操作系统、处理复杂逻辑和调度,FPGA擅长做高吞吐量的并行计算。两者之间通过AXI总线高速互联,数据交换延迟只有几十个时钟周期。

QQ_778132974的博客 378

保姆级教程:在Ubuntu 22.04上从源码编译ZLMediaKit和WVP-Pro,搭建企业级GB28181视频平台

本文提供在Ubuntu 22.04上从源码编译ZLMediaKit和WVP-Pro的详细教程,帮助企业搭建高可用的GB28181视频平台。涵盖环境准备、源码编译、系统集成与调优等关键步骤,特别适合需要深度定制化开发的企业环境。

weixin_33737134的博客 231

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

ROS学习笔记——基于Prometheus无人机开源项目仿真环境配置

本笔记基于ubuntu18.04版本,且已经在电脑上安装了ROS,Mavros功能包,其余可参考Amov教程, https://github.com/amov-lab/Prometheus/wiki/%E5%AE%89%E8%A3%85%E5%8F%8A%E7%BC%96%E8%AF%91https://github.com/amov-lab/Prometheus/wiki/%E5%AE%89%E8%A3%85%E5%8F%8A%E7%BC%96%E8%AF%91...

qq_52199356的博客 3542

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

阿木实验室Prometheus无人机项目下载编译与仿真跑通指南

无人机二次开发中,PX4与ROS是两大核心支柱,而Gazebo仿真环境则为算法验证提供了安全高效的试验场。对于开发者而言,搭建一套完整的无人机软件开发基线,往往需要处理固件通信、仿真配置、视觉数据接入等多重难题,底层工程的复杂度常常掩盖了算法本身的价值。阿木实验室开源的Prometheus项目,正是为解决这一痛点而生。它基于PX4、ROS和Gazebo,将机载电脑与飞控的通信链路、仿真世界构建、目标检测与集群控制等模块统一封装,形成一套开箱即用的无人机开发平台。通过理解其架构设计与编译流程,开发者可以快速跑

weixin_34252090的博客 147

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: IT项目研发过程中的利器——用Top分析CPU利用率
下一篇: 在ubuntu上搭建系统监控系统
breaksoftware
breaksoftware 领域专家: 操作系统技术领域 领域专家: 操作系统技术领域
博客等级 码龄20年 6901粉丝 724原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

breaksoftware

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值