TinyUI

TinyUI C++轻量级界面库 TinyUI C++轻量级界面库 有兴趣的下载下俩看看 立即下载

    TinyUI是本人在疫情期间开发的一套可移植的嵌入式UI库,如果感兴趣的人比较多将开源出来。

---------------------------------------------------------------------------------------------------------------------------------

    windows模拟器演示程序。
    下载地址:https://pan.baidu.com/s/1b7f0zfAe6KnKGL3vhicc6g
    提取码: yp6q

---------------------------------------------------------------------------------------------------------------------------------

  TinyUI相关博客:

     1. TinyUI-TUIWindow-最简单的自定义

     2. TinyUI-TUIListView最简单的使用

     3. TinyUI-TUIListView多列文本显示最简单的使用

     4. TinyUI-LCD驱动对接

     5. TinyUI-按键对接

 

  TinyUI简介:

    TinyUI是一套适用于嵌入式平台开发的UI库,具有比较完整的事件驱动系统,该UI库使用方便简单。

    目前基于低端嵌入式UI大多使用C语言进行开发或设计界面时需要计算UI组件/控件坐标,无法提高产品开发效率,或大多数嵌入式开发人员自行涉及UI,大多设计都在中断中显示UI或处理业务逻辑。另外一个更重要的问题即是无法自适应不同尺寸的屏幕,每开发新的产品或更换屏幕时都需要大量的修改或重写。

    本UI库使用C++(C++ 11或以上版本)进行开发,其大多数UI组件/控件均参考主流平台进行设计,如ListView、GridView、LinearLayout、Spinner、ScrollView、TabView、Dialog等UI组件基本设计与Android一致,并且这些UI组件/控件的使用方法均与Android APP开发一致;其中GridLayout的使用方法与WPF/UWP基本一致。

TinyUI主要特点:

    1. 提供LinearLayout和GridLayout等2种UI布局,可自适应不同尺寸屏幕,并且可以布局嵌套;

    2. UI组件/控件使用简单,与主流平台设计相似;

    3. 对于处理器是否集成LCD控制器均支持,并且如果内存够大还可以支持双缓存,可支持任意大小尺寸屏幕;

    4. 对无触摸(但需要有按键),几乎所有可获得焦点的UI组件/控件均可绑定按键,当物理按键按下时UI组件/控件自动响应事件,而无需开发人员进行处理;

    5. 所有的UI组件/控件可用功能比较丰富,如: TextView提供多种对齐、跑马方式,以及省略号结尾等;

    6. 移植简单,底层驱动只需实现TinyUI定义的4个接口即可,如: LCD、按键、定时器、触摸;

    7. TinyUI使用自定义字库(支持矢量字体与非矢量字体);

        7.1 矢量字体

        矢量字体显示使得文字细节非常丰富(把本模拟器截图粘贴到windows自带画图中,放大数倍即可看到字体细节),字体放大后的效果如下;

        7.2 非矢量字体

    8. TinyUI可移植目标平台丰富;

    9. TinyUI使用UTF8编码;

    10. 与硬件外设无关的应用可使用Visual studio并基于模拟器进行开发;

目前模拟器未使用鼠标钩子,使用钩子需要转换坐标:),有时鼠标抬起事件会丢失。TinyUI由本人/个人开发&测试,开发时间不足2个月,因此部分小UI组件/控件还未完成,同时会存在一定的BUG。

 

 

------------- TinyUI非常年轻,它的的发展需要大家的支持,您的支持将是我最大的动力。

 

如下贴出部分演示代码:

AboutWindow.h


class AboutWindow : public TUIWindow, public TUIButtonListener
{
public:
    AboutWindow(TUIWindow* parent = nullptr);
    virtual ~AboutWindow();

    void onShow();
    void onClose();

    void onClick(TUIButton* view);

private:
    TUIGridLayout rootLayout; // 顶层内容视图使用GridLayout
    TUIButton backButton; // 返回按钮
};

 

AboutWindow.cpp

AboutWindow::AboutWindow(TUIWindow* parent)
    : TUIWindow(parent)
{
    setContentView(&this->rootLayout); // 设置GridLayout为当前窗口的内容视图

    this->rootLayout.setRowNumber(3); // 3行
    this->rootLayout.setColumnNumber(2); // 3列

    this->rootLayout.setRowHeight(0, 30); // 第1行高30
    this->rootLayout.setRowHeight(1, 30); // 第2行高30
    this->rootLayout.setRowHeight(2, TUILAYOUT_DIM::TUI_MATCH_REMAIN); // 第3行高占满剩余空间

    this->rootLayout.setColumnWidth(0, 50); // 第1列宽50
    this->rootLayout.setColumnWidth(1, TUILAYOUT_DIM::TUI_MATCH_REMAIN); // 第2列占满剩余空间

    this->backButton.setText(L"返回");
    this->backButton.setMargin(2, 0, 2, 0); // 设置按钮外边距(顺序: 左->上->右->下)
    this->backButton.registerListener(this); // 当前窗口监听backButton点击事件
    this->backButton.bindKeycode(TUIVKCode::TUIVK_BACK); // backButton绑定回退键
    this->rootLayout.addView(&this->backButton, 0, 0); // backButton放到第0行,第0列
}

 

显示AboutWindow:

aboutWindow.show();

 

 

移植

TinyUI本身并不需要使用者做大量的工作,除非你需要更高级的功能(需要提供一个软中断给TinyUI)。

 

移植的难易程度取决于你的驱动结构好坏。

 

注: 我的驱动是C写的

 

1. 定时器接口移植

UITimer::UITimer(int32_t id)
{
    if (0 == id)
    {
        normal_timer = (timer_t *)device_driver_autowired(DDTYPE_TIMER, DDID_TIMER02);
		normal_timer->ops->open(TIMER_MILLISECOND, TIMER_CONTINUOUS);
    }
}

UITimer::~UITimer()
{

}

void UITimer::start(uint32_t millisecond)
{
    if (nullptr == normal_timer)
    {
        return;
    }

    normal_timer->ops->start(millisecond);
}

void UITimer::stop()
{
    if (nullptr == normal_timer)
    {
        return;
    }

    normal_timer->ops->close();
}


void UITimer::registerCallback(timeoutCallback callback)
{
    if (nullptr == normal_timer)
    {
        return;
    }

    normal_timer->ops->register_timeout_callback(callback);
}

 

2. LCD接口移植

UIDisplay::UIDisplay()
{
    ili9341 = (lcd_controller_t *)device_driver_autowired(DDTYPE_LCD_CONTROLLER, DDID_LCD_CONTROLLER_ILI9341);
    ili9341->ops->open();
}

UIDisplay::~UIDisplay()
{

}

bool UIDisplay::readPoint(int32_t x, int32_t y, color_t* color)
{
    uint16_t c = 0;
    ili9341->ops->read_point(x, y, &c);

    *color = c;

    return true;
}

void UIDisplay::drawPoint(int32_t x, int32_t y, int32_t visibleX1, int32_t visibleY1, int32_t visibleX2, int32_t visibleY2, color_t color)
{
    ili9341->ops->draw_point(x, y, color);
}

void UIDisplay::drawLine(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t visibleX1, int32_t visibleY1, int32_t visibleX2, int32_t visibleY2, color_t color)
{
    ili9341->ops->draw_line(x1, y1, x2, y2, color);
}

void UIDisplay::drawBuffer(int32_t x, int32_t y, uint32_t bufferWidth, uint32_t bufferHeight, int32_t visibleX1, int32_t visibleY1, int32_t visibleX2, int32_t visibleY2, const uint8_t* buffer)
{
    ili9341->ops->draw_buffer(x, y, bufferWidth, bufferHeight, buffer);
}


void UIDisplay::clear(int32_t x, int32_t y, uint32_t width, uint32_t height, int32_t visibleX1, int32_t visibleY1, int32_t visibleX2, int32_t visibleY2, color_t color)
{
    ili9341->ops->clear(x, y, width, height, color);
}

uint8_t UIDisplay::getBPP()
{
    return ili9341->ops->get_bpp();
}

uint32_t UIDisplay::getScreenWidth()
{
    return ili9341->ops->get_width();
}

uint32_t UIDisplay::getScreenHeight()
{
    return ili9341->ops->get_height();
}

uint8_t* UIDisplay::getFB()
{
    //return g_FrameBuffer; // 不支持
    return nullptr;
}

void UIDisplay::submit(uint8_t* buffer)
{
    //ili9341->ops->draw_buffer(0, 0, 320, 240, g_FrameBuffer); // 不支持
}

 

3. TinyUI初始化及驱动

void initTinyUI()
{
    TUIInit(); // Tiny初始化

    UIDisplay *display = new UIDisplay();
    TUIRegisterFBInterface(display); // 注册显示接口

    UITimer *timer0 = new UITimer(0); // 实例化一个定时器给TinyUI使用
    TUIRegisterTimerInterface(0, timer0);

    string filePath = "1:font.tui"; // 字库路径
    TUIRegisterFontInterface(TUIFontRenderer::instance(), filePath.c_str()); // 注册字体渲染器,TinyUI运行自定义

    MyLauncher* myLauncher = new MyLauncher(); // 定义自己的主界面
    TUIStartup(myLauncher); // 把自己的主界面注册到TinyUI中
}

 

TinyUI-windows模拟器演示程序 TinyUI是一套适用于嵌入式平台开发的UI库,具有比较完整的事件驱动系统,该UI库使用方便简单。 本UI库使用C++(C++ 11或以上版本)进行开发,其大多数UI组件/控件均参考主流平台进行设计,如ListView、GridView、LinearLayout、Spinner、ScrollView、TabView、Dialog等UI组件基本设计与Android一致,并且这些UI组件/控件的使用方法均与Android APP开发一致;其中GridLayout的使用方法与WPF/UWP基本一致。 附件是TinyUI在windows下的模拟器演示程序。 立即下载

相关推荐

tinyui:一个微型UI宏,用于将xml文件中声明的ui项注入到haxe类中。 受到stablexui的启发。 与OpenFL一起使用

Tinyui 一个微小的UI宏,用于将xml文件中声明的ui项注入到haxe类中 特征 微小的。 只有一个@:build宏文件 跨平台 非常简单:仅将xml中声明的UI转换为haxe代码。 不使用反射 透明地从ui访问代码和从ui访问代码 非常强大-参见 非常稳定 因为它是如此简单(仅将xml视图转换为简单的haxe代码) tinyui用于数以百万计的用户在上玩的几种游戏(网络,iOS,Android) 安装 haxelib install tinyui 使用 宏构建类src/UI18All.hx // all things in-scope is accessible in xml, include static extension methods using com . sandinh . ui . BitmapTools ; using com . sandinh . Ti

TinyUI组件开发示例

TinyUI实际上并不是一个具体的UI展现组件,它只是一个UI构建体系。它可以适应于各种Html+CSS+JS的体系架构中。 TinyUI主要解决下面的问题: UI中JS的引入与顺序,JS合并的问题 UI中css的引入与顺序,CSS合并的问题 UI中碰到性能问题时的影响范围,比如:一个树出现问题,要改动许多用到树的地方 代码重复的问题,同样的内容在许多地方都有,如果要改动就要...

TINY框架 654

用Verilog在FPGA上做个电子琴:从矩阵键盘到蜂鸣器的完整实现(附代码)

本文详细介绍了如何使用Verilog在FPGA上实现一个完整的电子琴系统,涵盖矩阵键盘扫描、音调生成和蜂鸣器驱动等核心模块。通过模块化设计和PWM调制技术,开发者可以构建一个可交互的音乐播放器,项目代码完整且易于扩展,适合FPGA初学者和数字逻辑设计爱好者实践。

weixin_29191669的博客 405

TinyUI-TUIWindow-最简单的自定义

TinyUI与传统Windows开发类似,使用窗口(TUIWindow)作为其他UI组件的载体,其设计模式与传统windows、Android等平台开发类似属于MVC设计模式。 但TinyUI作为轻量级的UI库,开发者可以把它与其他第三方UI库一样使用,把一个一个组件通过计算/设置坐标的方式使其展示在屏幕中,即通过调用UI组件的setGeometry()方法设置控件的...

OneOnce的专栏 2428

在Ubuntu 22.04 LTS上搞定Intel Quartus Prime 22.1和QuestaSim:一份保姆级的安装与License配置指南

本文提供在Ubuntu 22.04 LTS上安装和配置Intel Quartus Prime 22.1与QuestaSim的详细指南。涵盖依赖安装、环境变量设置、License配置及常见问题解决,帮助FPGA开发者快速搭建稳定的开发环境。特别针对Ubuntu系统优化,确保工具链高效运行。

weixin_29208077的博客 321

DeepSeek安装教程

两分钟讲述deepseek正确安装教程

weixin_45906703的博客 1670

TinyUI-LCD驱动对接

TinyUI对于MCU是否集成LCD控制器都支持,但需要实现TinyUI定义的TUIFBInterface纯虚类接口,FB为frame buffer的缩写。该接口部分方法是否需要实现依赖于当前需要移植的MCU是否集成LCD控制器,如果集成了LCD控制器,则只需实现极少部分的方法,但是如果MCU未集成LCD控制器,则可能需要实现大部分的方法。 TinyUI定义的显示接口 TU...

OneOnce的专栏 734

Fiori Elements Analytical List Page 标题区配置全攻略:从变体、过滤模式到 UI.KPI 的工程化落地

ALP标题区是Fiori Elements Analytical List Page的核心交互区域,承担变体管理、过滤模式切换、KPI展示等关键功能。本文系统解析了标题区的组成结构、可用能力及工程实现要点,包括:1)标题区包含过滤类型切换、全局KPI、变体管理等交互元素;2)详细说明视觉过滤与紧凑过滤的同步规则及实现方式;3)介绍OData V2下通过UI.KPI注解配置标题区KPI的方法;4)提供manifest.json配置示例和CDS注解写法。文章还对比了V2与V4版本的差异,为ALP开发提供实用指导

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 252

STM32通过按键控制LED灯示例

STM32F407ZE 通过按键控制LED灯示例,要求: ①按键按下 D1亮 按键松开 D1灭 ②按键按下一次 D1亮 按键再按下一次 D1灭 ----(按键每按下一次D1实现翻转) 需要注意的是按键需用到延时消抖,延时时长按实际进行修改,检测按键按下与松开应该使用标志位等区分,如果只是通过读取按键返回值判断,在while循环里可能会对同一个LED灯多次操作。 #include <stm32f4xx.h> void delay_ms(int ms) //延时函数 {

佳佳鸽的博客 1万+

203.华为组网实例:VLAN间互通DHCP中继实验

SW核心交换机上配置DHCP中继。

迷逝 8438

YOLOv5 实现 10 种热力图可视化方式教程 | GradCAM XGradCAM ScoreCAM LayerCAM HiResCAM EigenCAM....

基于梯度计算类激活图,是最经典的热力图生成方法之一。Grad-CAM的改进版,通过引入梯度加权的方式,提高了热力图的定位精度。基于类别的得分计算类激活图,对噪声具有更强的鲁棒性。基于特定层的特征图计算类激活图,可以灵活选择不同的层进行分析。通过上采样将低分辨率的特征图恢复到原始图像大小,提高了热力图的分辨率。基于特征图的特征向量进行PCA降维,得到更简洁的热力图。对Grad-CAM的进一步改进,通过加权平均的方式,提高了热力图的质量。基于积分梯度的方法,可以解释模型对输入的每个特征的贡献。

weixin_39818775的博客 2381

TinyUI-按键对接

对于无触摸的嵌入式设备来说,按键就是整个人机交互的入口点,TinyUI定义了按键接口类TUIKeyInterface,当需要把底层驱动和TinyUI对接时,需要实现一个自定义按键类,继承自TUIKeyInterface接口即可,最后把自定义按键类实例化,并调用TinyUI的按键注册接口TUIRegisterKeyInterface即可。 TUIKeyInterfa...

OneOnce的专栏 512

企业财务共享服务中心业务蓝图规划方案【附全文阅读】

《企业财务共享服务中心业务蓝图规划方案》为集团企业提供财务共享中心建设全流程指导,涵盖战略定位、组织架构、业务流程、信息系统、运营管理和变革实施六大维度。方案明确共享中心"交易处理+战略支撑"双重职能,设计专业分组架构,筛选标准化高、价值明确的流程(如核算、资金结算等)纳入共享范围,构建业财一体化平台,并配套绩效与风险管控体系。结合项目型企业管理特点,分阶段推进实施,助力企业实现财务集中化与标准化转型。

cdfunlove的博客 999

TinyUI-TUIListView最简单的使用

在TinyUI简介的博客中提到其特点中包含一条,即多大控件的使用方法和android移植,除了语言差异之外,本篇我们就介绍列表控件TUIListView最简单的使用方法。 列表组件/控件作为目前Android/iOS的APP中最常用的控件,该控件的设计同时参考Android、windows、Qt等使用的经验进行筛选,最终选择了Android的ListView设计,...

OneOnce的专栏 1505

曲线最小二乘拟合基础

介绍曲线拟合的最小二乘原理,介绍了常规最小二乘和正交最小二乘算法,最后介绍了MathNet矩阵运算库的基本操作。

yh523的博客 1306

深度学习工具包 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")

TinyUI入门实践之快速构建个人网站

http://my.oschina.net/tinyframework/blog?catalog=377413 TinyUI入门实践之快速构建个人网站 http://my.oschina.net/tinyframework/blog/348587 Tiny框架

vanloswang的专栏 2368

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

TinyUI-TUIListView多列文本显示最简单的使用

在上一篇TinyUI-TUIListView最简单的使用中介绍了TUIListView单列文本最基本的事情情况,显示使用TinyUI内置的TUISimpleAdapter可以很轻松的完成单列文本列表。 实际开发过程中可能需要有多列显示情况,如果只需显示多列文本列表,TinyUI同样也内置了用于多列文本显示的adapter,即TUISimpleMultiAdapte...

OneOnce的专栏 649

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

《开源框架那点事儿20》:公布TinyUI前端框架

曾经发表过一篇文章:TinyAdmin前端展现框架,其在线演示路径为:http://www.tinygroup.org/tinyadmin/,应该说有很多人还是感觉兴趣的。可是因为这个是基于SmartAdmin框架改写的,尽管我们自己买了SmartAdmin的授权。可是广大用户假设要用的时候,就会有授权相关的问题。这会大大影响一些人的使用决策--尤其是会再发行的朋友。 再一个原因是S...

adr5970的博客 226

《开源框架那点事儿20》:发布TinyUI前端框架

以前发表过一篇文章:TinyAdmin前端展现框架,其在线演示路径为:http://www.tinygroup.org/tinyadmin/,应该说有许多人还是感觉兴趣的,但是由于这个是基于SmartAdmin框架改写的,虽然我们自己买了SmartAdmin的授权,但是广大用户如果要用的时候,就会有授权相关的问题,这会大大影响一些人的使用决策--尤其是会再发行的朋友。 再一个原因是SmartAdm

柏图 4718

判断按键值_TinyUI(嵌入式UI库)-按键移植

TinyUI是一套用于嵌入式开发的UI库。TinyUI定义了与windows类似的虚拟按键码,一般嵌入式设备可能会有物理按键,物理按键可以与虚拟键码绑定/关联,期望当按下物理按键后(需把虚拟键码和界面元素进行绑定),界面可以得到相应并执行相应的操作。对于无触摸的嵌入式设备来说,按键就是整个人机交互的入口点,TinyUI定义了按键接口类TUIKeyInterface,当需要把底层驱动和TinyUI对...

weixin_34355348的博客 295
上一篇: 《linux设备驱动开发详解》笔记——18 ARM linux设备树
下一篇: TinyUI-TUIWindow-最简单的自定义
OneOnce
博客等级 码龄17年 67粉丝 43原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

打赏作者

OneOnce

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

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

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

打赏作者

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

抵扣说明:

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

余额充值