三、wpa_driver_ops内部定义很多函数指针,通过这些定义的函数指针,WPAS能隔离上层使用者和具体的driver。
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211", //driver wrapper的名称
.desc = "Linux nl80211/cfg80211", //描述信息
.get_bssid = wpa_driver_nl80211_get_bssid, //用于获取 bssid
.get_ssid = wpa_driver_nl80211_get_ssid,
.set_key = driver_nl80211_set_key,
.scan2 = driver_nl80211_scan2, //扫描函数
.sched_scan = wpa_driver_nl80211_sched_scan,
.stop_sched_scan = wpa_driver_nl80211_stop_sched_scan,
.get_scan_results2 = wpa_driver_nl80211_get_scan_results, //获取扫描结果
.deauthenticate = driver_nl80211_deauthenticate,
.authenticate = driver_nl80211_authenticate, //触发 authentication 操作
.associate = wpa_driver_nl80211_associate, //触发 association 操作
.global_init = nl80211_global_init, //driver wrapper 全局初始化函数,该函数的返回值保存在 wpa_global 成员变量 drv_pri 数组中
.global_deinit = nl80211_global_deinit,
.init2 = wpa_driver_nl80211_init, //driver wrapper 初始化函数
.deinit = driver_nl80211_deinit,
.get_capa = wpa_driver_nl80211_get_capa,
.set_operstate = wpa_driver_nl80211_set_operstate,
.set_supp_port = wpa_driver_nl80211_set_supp_port,
.set_country = wpa_driver_nl80211_set_country,
.get_country = wpa_driver_nl80211_get_country,
.set_ap = wpa_driver_nl80211_set_ap,
.set_acl = wpa_driver_nl80211_set_acl,
.if_add = wpa_driver_nl80211_if_add,
.if_remove = driver_nl80211_if_remove,
.send_mlme = driver_nl80211_send_mlme,
.get_hw_feature_data = wpa_driver_nl80211_get_hw_feature_data,
.sta_add = wpa_driver_nl80211_sta_add,
.sta_remove = driver_nl80211_sta_remove,
.hapd_send_eapol = wpa_driver_nl80211_hapd_send_eapol,
.sta_set_flags = wpa_driver_nl80211_sta_set_flags,
.hapd_init = i802_init,
.hapd_deinit = i802_deinit,
.set_wds_sta = i802_set_wds_sta,
.get_seqnum = i802_get_seqnum,
.flush = i802_flush,
.get_inact_sec = i802_get_inact_sec,
.sta_clear_stats = i802_sta_clear_stats,
.set_rts = i802_set_rts,
.set_frag = i802_set_frag,
.set_tx_queue_params = i802_set_tx_queue_params,
.set_sta_vlan = driver_nl80211_set_sta_vlan,
.sta_deauth = i802_sta_deauth,
.sta_disassoc = i802_sta_disassoc,
.read_sta_data = driver_nl80211_read_sta_data,
.set_freq = i802_set_freq,
.send_action = driver_nl80211_send_action,
.send_action_cancel_wait = wpa_driver_nl80211_send_action_cancel_wait,
.remain_on_channel = wpa_driver_nl80211_remain_on_channel,
.cancel_remain_on_channel = wpa_driver_nl80211_cancel_remain_on_channel,
.probe_req_report = driver_nl80211_probe_req_report,
.deinit_ap = wpa_driver_nl80211_deinit_ap,
.deinit_p2p_cli = wpa_driver_nl80211_deinit_p2p_cli,
.resume = wpa_driver_nl80211_resume,
.send_ft_action = nl80211_send_ft_action,
.signal_monitor = nl80211_signal_monitor,
.signal_poll = nl80211_signal_poll,
.send_frame = nl80211_send_frame,
.shared_freq = wpa_driver_nl80211_shared_freq,
.set_param = nl80211_set_param,
.get_radio_name = nl80211_get_radio_name,
.add_pmkid = nl80211_add_pmkid,
.remove_pmkid = nl80211_remove_pmkid,
.flush_pmkid = nl80211_flush_pmkid,
.set_rekey_info = nl80211_set_rekey_info,
.poll_client = nl80211_poll_client,
.set_p2p_powersave = nl80211_set_p2p_powersave,
.start_dfs_cac = nl80211_start_radar_detection,
.stop_ap = wpa_driver_nl80211_stop_ap,
#ifdef CONFIG_TDLS
.send_tdls_mgmt = nl80211_send_tdls_mgmt,
.tdls_oper = nl80211_tdls_oper,
#endif /* CONFIG_TDLS */
.update_ft_ies = wpa_driver_nl80211_update_ft_ies,
.get_mac_addr = wpa_driver_nl80211_get_macaddr,
.get_survey = wpa_driver_nl80211_get_survey,
.status = wpa_driver_nl80211_status,
.switch_channel = nl80211_switch_channel,
#ifdef ANDROID_P2P
.set_noa = wpa_driver_set_p2p_noa,
.get_noa = wpa_driver_get_p2p_noa,
.set_ap_wps_ie = wpa_driver_set_ap_wps_p2p_ie,
#endif /* ANDROID_P2P */
#ifdef ANDROID
.driver_cmd = wpa_driver_nl80211_driver_cmd, //用于处理和具体驱动相关的命令
#endif /* ANDROID */
.vendor_cmd = nl80211_vendor_cmd,
.set_qos_map = nl80211_set_qos_map,
.set_wowlan = nl80211_set_wowlan,
.roaming = nl80211_roaming,
.set_mac_addr = nl80211_set_mac_addr,
};
相关推荐
安卓15 wifi 打开源码分析-从上层到wifi驱动及wpa_supplicant启动
以高通 wifi 驱动为例,insmod 的时候会调用 hdd_driver 的 init 函数,其会调用对外的字符设备驱动提供的 write 函数wlan_hdd_state_ctrl_param_write。一般在 boot 阶段 wifi 驱动已经安装了,这里主要是调用字符设备驱动写接口告诉 hdd_driver wifi 打开了。wifi 设置获取到 WifiManager 这个代理调用setWifiEnabled 打开 wifi。向状态机发送CMD_WIFI_TOGGLED 消息。
【转载】wifi详解(一)
作为全球公认的局域网权威,IEEE802工作组建立的标准在过去二十年内在局域网领域独领风骚。这些协议包括了802.3Ethernet协议、802.5TokenRing协议、802.3z100BASE-T快速以太网协议。在1997年,经过了7年的工作以后,IEEE发布了802.11协议,这也是在无线局域网领域内的第一个国际上被认可的协议。
Android wifi探究二:Wifi framework层源码分析
上一篇博客初步认识了wpa_supplicant的作用和使用方法,并且尝试着梳理了wifi的大框架,不过,java层的框架我们忽略了,没有分析,也就是说上一篇博客非常肤浅的支出了wifi代码的结构,仅此而已,那么这篇博客,将尝试梳理wifi的java层框架。
用户层调用nl80211的例子
nl80211 是基于 802.11 netlink 的用户空间接口,用于无线硬件的新 cfg80211 配置系统。它们一起旨在取代旧的无线扩展。
Android wifi源码分析(二) Wifi关闭流程
接着上一篇,这篇说一下Wifi的关闭流程。 由上一篇可以知道,framework层提供的wifi开关接口都是**setWifiEnabled**,只是参数不同而已。*true*表示开启wifi、*false*表示关闭wifi。
Android 5.1系统源码Wifi模块中wifiSettings源码分析
在谷歌提供的安卓源码中,网址如下:http://androidxref.com ,初学者学习,分析,留疑问,并且长期更新,修改错误,补充。 安卓的系统wifi模块,一般在设置----->Wifi中 WifiSettings显示的就是打开wifi的那个界面
Android Wi-Fi源码分析之wpa_supplicant初始化(一)
一. wpa_supplicant配置编译将对应的平台的wpa_supplicant包解压改名为wpa_supplicant_8替换掉external下的wpa_supplicant_8目录 执行: source build/envsetup.sh lunch qiyang_6dq-user根据平台定制所需要的wpa_supplican版本, 修改: BoardConfig.mk
【Android-WIFI】(五) Roaming机制HAL层源码分析
我们首先来看看 wpa_supplicant 进程的初始化。在 wpa_supplicant 进程的 main 函数中,初始化了 wpa_global 对象供整个进程使用。wpa_supplicant 进程主要是向上接受上层关于 WiFi 的请求,然后向下层内核驱动发送通信。所以这里通过 IO 多路复用来轮询监听相应的事件。wpa_global 中的 每一个 wpa_supplicant 对象都是一个 wpa_supplicant 接口,其中都配置了对应的驱动接口。可选驱动如上图所示。
Wifi模块—源码分析Wifi启动(Android P)
一、前言 Android P在wifi这块改动挺大的,Wifi到AndoidO之后不再使用jni,所以AndroidP也一样不再使用jni来实现Java代码与本地的C/C++代码交互,而是使用HIDL,Hardware Interface Define Language。摒弃了以前的hardware/libhardware_legacy/wifi/wifi.c作为底层接口,所以得重新梳理下整个w...
Wifi wpa_supplicant 到驱动的联系
Int wpa_driver_wext_scan(void *priv, const u8 *ssid,size_t ssid_len)中的LINE1174:if(ioctl(drv->ioctl_sock,SIOCSIWWSCAN,&iwr) < 0)从这里可以看出wpa_supplicant是通过IOCTL来调用SOCKET与driver进行通信的,并给DRIVER下达SIOCSIWSCAN这个命令。//创建了接受wpa_supplicant 的socket接口。//这个函数超级重要,后面详细的看。
告别Nginx原始日志!VictoriaLogs+Grafana构建企业级应用日志分析平台实战
描述:做为一个合格的运维工程师,在面对企业安全运维管理中,日志审计是一项非常重要的工作。授人以鱼不如授人以渔,各位运友们可参照作者的方案设计,在自己的项目中根据实际情况调整落地,例如,不在仅仅采集 NGINX 应用日志,而是采集 Apache、Tomcat、SpringBoot 等多种应用服务器的日志,又如,不再仅仅采集网络设备、安全审计审计日志,而是 Windows、Linux 等多种操作系统的审计日志等,大家可充分发挥想象、实践能力,也欢迎大家在知识星球中分享自己的方案设计,一起交流学习。
Wifi模块—源码分析Wifi启动1(Android P)
一 前言 android框架层的函数调用是出了名的绕,开发者可能因为各种原因比如避免冲突、条件判断、函数封装等等各种各样需要考虑的因素而使得框架层的方法调用显得比较长,所以看源码的时候先看大体流程,有需要再深入某些重要的细节。不然一入源码深似海,会淹没在茫茫源码中。繁杂的东西,自己只要不凌乱,找好线索,进行总结,便会简单。 二 图示调用流程 ...
初识Renode
1. 简介 Renode是Antmicro公司发布的一个开发框架,使得开发人员通过模拟物理硬件系统(包括CPU、外围设备、传感器、环境以及节点之间的有线或无线介质),加速物联网和嵌入式系统的开发。它可在PC上通过软件对嵌入式设备进行模拟,可模拟Cortex-M、Cortex-A、RISC-V和其他CPU,并可模拟外设以及各种通信总线和接口。其指令模拟器使用C语言开发,外设模拟器使用C#语言开发,测试及输出层面的内容则用python编写。 Renode官网:Renodehttps://renode.io/
Wifi模块—源码分析Wifi启动2(Android P)
一 前言 在上一篇分析了wifi启动的流程,从Android应用层一直分析到了Java框架层,这次我们接着往下走流程。如果没有看上一篇的建议先回头看看 Wifi模块—源码分析Wifi启动1(Android P)这样能更好地认知和把握wifi的启动过程。 二 图示调用流程 这个调用流程图也是基于上一篇的流程图进一步完善的得到的。 三 代码具体流程 1 应...
使用 git一个仓库管理多个项目
我们需要在 git 里面创建一个空分支,该分支不继承任何提交,没有父节点,完全是一个干净的分支,这时候就需要使用 orphan。该命令会创建一个新的分支,并且该分支有前一个分支下的所有文件,我们不想提交任何内容,所以我们需要把当前内容全部删除。此时 master 分支已经有一个项目了,下面我们创建新的分支管理另一个项目。此时可以在该分支目录上初始化你的项目,在执行 git 命令提交代码。此时我们就完成了在同一个仓库管理不同项目的需求了。下载仓库到本地之后,进入项目目录,查看分支信息。
ESP32-BLE学习1-建立简单的server
start 学习之前,我想尝试使用ESP32的demo建立一个简单的server与手机接进行最基本的数据通信。 这里有BLE的简单讲解BLE资料 因为BLE的连接是具有主从机特性的,就像SPI,USB一些请求只能由主机端发起,连接也需要主机端发起。所以手机要想连上ESP32,就得将ESP32设置为从机模式。 从资料上可以看到,从机端通过Notify通知主机,所以从机就是GATT Server。 在进行ESP32 的demo学习之前,得大体看下ESP32的蓝牙组成,ESP32支持经典蓝牙和低功耗蓝牙4.2,
android wifi-wpa_supplicant_源码分析(一)
wpa_supplicant 是一个开源软件项目,它实现了 Station 对无线网络进行管理和控制的功能。一、main函数分析 (/external/wpa_supplicant_8/wpa_supplicant/main.c) int main(int argc, char *argv[]) { int c, i; struct wpa_interface *ifaces, *iface; int iface_count, exit...
文本→图像→视频:AIGC跨模态转换全流程解析
本文旨在系统性地解析AIGC领域中跨模态内容生成的技术原理和实现方法,特别聚焦于从文本到图像再到视频的完整转换流程。跨模态表示学习的基本原理文本到图像生成的核心技术图像到视频转换的关键算法端到端跨模态生成系统的构建方法实际应用场景和性能优化策略背景介绍:建立基本概念和知识框架核心概念:解析跨模态转换的关键技术和原理算法细节:深入讲解文本到图像、图像到视频的核心算法数学模型:提供必要的数学基础和公式推导项目实战:通过完整案例展示实现过程应用场景:探讨技术的实际应用可能性。
Android wpa_supplicant源码分析–扫描scan过程
1 扫描过程 一个完整的扫描过程 下发命令–>wpa_s构建扫描参数–>驱动扫描–>wpa_s接收到驱动的扫描结果 接收到framework/wpa_cli下发的SCAN命令 if (os_strncmp(buf, "SCAN ", 5) == 0) { wpas_ctrl_scan(wpa_s, buf + 5, reply, reply_size, &am...
ESP8266入门(一)固件烧录及常见问题分析
为了实现对数据的远程收集和分析,偶然间发现了esp8266这个模块,对此进行了深入的学习,可是在学习之初遇到了大量的问题,这个系列文章就为大家讲讲我遇到的坑以及解决办法,还有esp8266如何连上oneNet云平台的方法。因为我用的是esp8266nodemcu,可以直接连接usb进行烧录,如果用模块的话接线就比较麻烦,可以去搜搜看.
超详细的YOLOv8安装与测试指南:让计算机视觉任务变得简单
python3+、Anaconda3或Miniconda3 Ultralytics提供了多种安装方法,包括pip、conda和Docker。通过pip包安装最新稳定版的YOLOv8,或者克隆Ultralytics GitHub仓库以获取最新版本。Docker可用于在隔离容器中执行包,避免本地安装。 最简单直接的方式就是直接使用pip方法直接安装。 也可以直接从GitHub仓库安装包。如果你想要最新的开发版本,这可能会很有用。确保你的系统上安装了Git命令行工具
Android wpa_supplicant 源码分析一 -- 简介
官方介绍地址:http://w1.fi/wpa_supplicant/devel/index.html 简介: wpa_supplicant 是适用于 Linux、BSD、Mac OS X 和 Windows 的 WPA 请求方,支持 WPA 和 WPA2 (IEEE 802.11i / RSN)。它适用于台式机/笔记本电脑和嵌入式系统。Supplicant 是客户端工作站中使用的 IEEE 802.1X/WPA 组件。它与 WPA Authenticator 实现密钥协商,并控制 wlan 驱动程序.
「HTML和CSS入门指南」hr 标签详解
标签是 HTML5 中用于插入水平分割线的标签,常用于在页面中添加分隔线或者段落之间的分割线。通过灵活运用 标签和属性,我们可以帮助用户更好地理解页面内容,同时也可以美化和装饰页面。在实际应用中需要注意避免过度使用 标签,以使页面看起来简洁明了。
Android wifi源码分析(一) Wifi启动流程
最近在解决wifi的一些问题,故研究下wifi源码。 该源码是基于Android4.3,其他版本略有改动,大致流程一样。 这篇主要说一下wifi的启动流程。
计算机控制技术及应用
《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。
SAP B1中文培訓教材_SDK
公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说
android wifi-wpa_supplicant_源码分析(二)
二、几种重要的结构体: 1、wpa_interface 用于描述一个无线网络设备(/external/wpa_supplicant_8/wpa_supplicant/wpa_supplicant_i.h) struct wpa_interface { /** * confname - Configuration name (file or profile) name * * This ...
深度学习工具包 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');```[](https://bitdeli.com/free "Bitdeli Badge")
Android wpa_supplicant 源码分析四 -- wpa_supplicant_add_iface()
wpa_supplicant_add_iface() wpa_supplicant_init_iface(wpa_s, &t_iface) // 读取wpa_supplicant.conf配置文件, /data/vendor/wifi/wpa/wpa_supplicant.conf , /vendor/etc/wifi/wpa_supplicant_overlay.conf wpa_config_read(w...
efm32 入门.pdf
本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。
1507



被折叠的 条评论
为什么被折叠?



