windows下安装redis(已经实践)--转

1:首先下载redis:redis-2.0.2.zip (32 bit),解压。
从下面地址下:http://code.google.com/p/servicestack/wiki/RedisWindowsDownload,看到下面有redis-2.0.2.zip (32 bit),就是他了,下载完成后,解压到D:\redis-2.0.2.
2:创建redis.conf文件:
这是一个配置文件,指定了redis的监听端口,timeout等。如下面有:port 6379。
把下面内容COPY到一新建文件中,取名redis.conf,再保存到redis-2.0.2目录下:


# Redis configuration file example

# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize no

# When run as a daemon, Redis write a pid file in /var/run/redis.pid by default.
# You can specify a custom pid file location here.
pidfile /var/run/redis.pid

# Accept connections on the specified port, default is 6379
port 6379

# If you want you can bind a single interface, if the bind option is not
# specified all the interfaces will listen for connections.
#
# bind 127.0.0.1

# Close the connection after a client is idle for N seconds (0 to disable)
timeout 300

# Set server verbosity to 'debug'
# it can be one of:
# debug (a lot of information, useful for development/testing)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
loglevel debug

# Specify the log file name. Also 'stdout' can be used to force
# the demon to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
logfile stdout

# Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where
# dbid is a number between 0 and 'databases'-1
databases 16

################################ SNAPSHOTTING #################################
#
# Save the DB on disk:
#
# save <seconds> <changes>
#
# Will save the DB if both the given number of seconds and the given
# number of write operations against the DB occurred.
#
# In the example below the behaviour will be to save:
# after 900 sec (15 min) if at least 1 key changed
# after 300 sec (5 min) if at least 10 keys changed
# after 60 sec if at least 10000 keys changed
save 900 1
save 300 10
save 60 10000

# Compress string objects using LZF when dump .rdb databases?
# For default that's set to 'yes' as it's almost always a win.
# If you want to save some CPU in the saving child set it to 'no' but
# the dataset will likely be bigger if you have compressible values or keys.
rdbcompression yes

# The filename where to dump the DB
dbfilename dump.rdb

# For default save/load DB in/from the working directory
# Note that you must specify a directory not a file name.
dir ./

################################# REPLICATION #################################

# Master-Slave replication. Use slaveof to make a Redis instance a copy of
# another Redis server. Note that the configuration is local to the slave
# so for example it is possible to configure the slave to save the DB with a
# different interval, or to listen to another port, and so on.
#
# slaveof <masterip> <masterport>

# If the master is password protected (using the "requirepass" configuration
# directive below) it is possible to tell the slave to authenticate before
# starting the replication synchronization process, otherwise the master will
# refuse the slave request.
#
# masterauth <master-password>

################################## SECURITY ###################################

# Require clients to issue AUTH <PASSWORD> before processing any other
# commands. This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# requirepass foobared

################################### LIMITS ####################################

# Set the max number of connected clients at the same time. By default there
# is no limit, and it's up to the number of file descriptors the Redis process
# is able to open. The special value '0' means no limts.
# Once the limit is reached Redis will close all the new connections sending
# an error 'max number of clients reached'.
#
# maxclients 128

# Don't use more memory than the specified amount of bytes.
# When the memory limit is reached Redis will try to remove keys with an
# EXPIRE set. It will try to start freeing keys that are going to expire
# in little time and preserve keys with a longer time to live.
# Redis will also try to remove objects from free lists if possible.
#
# If all this fails, Redis will start to reply with errors to commands
# that will use more memory, like SET, LPUSH, and so on, and will continue
# to reply to most read-only commands like GET.
#
# WARNING: maxmemory can be a good idea mainly if you want to use Redis as a
# 'state' server or cache, not as a real DB. When Redis is used as a real
# database the memory usage will grow over the weeks, it will be obvious if
# it is going to use too much memory in the long run, and you'll have the time
# to upgrade. With maxmemory after the limit is reached you'll start to get
# errors for write operations, and this may even lead to DB inconsistency.
#
# maxmemory <bytes>

############################## APPEND ONLY MODE ###############################

# By default Redis asynchronously dumps the dataset on disk. If you can live
# with the idea that the latest records will be lost if something like a crash
# happens this is the preferred way to run Redis. If instead you care a lot
# about your data and don't want to that a single record can get lost you should
# enable the append only mode: when this mode is enabled Redis will append
# every write operation received in the file appendonly.log. This file will
# be read on startup in order to rebuild the full dataset in memory.
#
# Note that you can have both the async dumps and the append only file if you
# like (you have to comment the "save" statements above to disable the dumps).
# Still if append only mode is enabled Redis will load the data from the
# log file at startup ignoring the dump.rdb file.
#
# The name of the append only file is "appendonly.log"
#
# IMPORTANT: Check the BGREWRITEAOF to check how to rewrite the append
# log file in background when it gets too big.

appendonly no

# The fsync() call tells the Operating System to actually write data on disk
# instead to wait for more data in the output buffer. Some OS will really flush
# data on disk, some other OS will just try to do it ASAP.
#
# Redis supports three different modes:
#
# no: don't fsync, just let the OS flush the data when it wants. Faster.
# always: fsync after every write to the append only log . Slow, Safest.
# everysec: fsync only if one second passed since the last fsync. Compromise.
#
# The default is "always" that's the safer of the options. It's up to you to
# understand if you can relax this to "everysec" that will fsync every second
# or to "no" that will let the operating system flush the output buffer when
# it want, for better performances (but if you can live with the idea of
# some data loss consider the default persistence mode that's snapshotting).

appendfsync always
# appendfsync everysec
# appendfsync no

############################### ADVANCED CONFIG ###############################

# Glue small output buffers together in order to send small replies in a
# single TCP packet. Uses a bit more CPU but most of the times it is a win
# in terms of number of queries per second. Use 'yes' if unsure.
glueoutputbuf yes

# Use object sharing. Can save a lot of memory if you have many common
# string in your dataset, but performs lookups against the shared objects
# pool so it uses more CPU and can be a bit slower. Usually it's a good
# idea.
#
# When object sharing is enabled (shareobjects yes) you can use
# shareobjectspoolsize to control the size of the pool used in order to try
# object sharing. A bigger pool size will lead to better sharing capabilities.
# In general you want this value to be at least the double of the number of
# very common strings you have in your dataset.
#
# WARNING: object sharing is experimental, don't enable this feature
# in production before of Redis 1.0-stable. Still please try this feature in
# your development environment so that we can test it better.
# shareobjects no
# shareobjectspoolsize 1024

3:在cmd下面执行以下命令,指定它使用我们的redis.conf,同时也是启动,把redis运行起来,这里指定用redis.conf的配置运行服务器
D:\redis-2.0.2>redis-server.exe redis.conf

4:开一新DOS窗口cmd.执行以下命令,这是Redis的客户端程序:
redis-cli.exe -h 172.18.5.1 -p 6379
172.18.5.1是我本机IP地址,端口6379就是上面配置文件中指定的监听端口
执行完成后,应该能看到redis启动了,这时在第一个cmd窗口可以看到连接信息。
执行一条保存key value操作
set mystock 300156
再查询一下
get mystock

=================================

可以完全参考以下地址的资料:

http://hi.baidu.com/zchare/blog/item/bd6034f325d1c65f352acca1.html(very good,安全可以成功)

http://cardyn.iteye.com/blog/794194
http://zhaohaolin.iteye.com/blog/1017561
windows下安装redis 相关的php_redis.dll和php_igbinary.dll可以去这里下载,里面有使用说明 http://pan.baidu.com/s/1kU134Fl 阅读详情

相关推荐

Windows上安装Redis

将Redis的可执行文件路径添加到系统的环境变量中,这样你就可以在任何命令行窗口中运行Redis命令。我们下载第一个redis-64.3.0.503.zip版本,使用这个版本安装。Redis在系统启动时自动运行,可将其设置为Windows服务。下载完成后,选择一个文件夹,将文件解压到你选择的目录。打开命令行窗口,切换到Redis的bin目录。运行以下命令 启动Redis服务器。选择适合Windows的版本下载。win版本安装redis,开机自启动

6457

redis在windwos上安装(详细教程+redis安装包+redis可视化工具安装包+命令大全)

0.redis安装包(window版) redis安装包提取码:1211 https://pan.baidu.com/s/1fWzxkEuDrKLgaD8Jqn0lNA redis使用大全https://download.csdn.net/download/qq_52385631/78964433 一. 傻瓜式安装,一路next,中间注意一个地方就行,添加环境变量的地方打勾 二. 安装完以后修改配置 1.修改配置文件 a. 打开redis安装的目录下的redis....

python_web全栈 7733

Redis for Windows安装与客户端实践指南

Redis(Remote Dictionary Server)是一个开源的使用ANSI C语言编写、支持网络、基于内存且可持久化的高性能键值数据库。由于其出色的性能和灵活的数据结构支持,Redis被广泛应用于各种IT场景中,特别是在需要快速读写能力的系统中。在众多Redis客户端中,有一些因其易用性和强大的功能而备受青睐。以下是一些流行的客户端工具::这是一个图形界面的客户端,适用于Windows、Linux和macOS平台。它提供了一个直观的界面来浏览数据类型,执行基本的数据操作和管理任务。

weixin_28721743的博客 992

Redis的安装及使用

这里先介绍一下Windows环境下Redis的安装和使用,其他的等以后有时间再补充。 先在下载redis(我电脑上是redis-2.0.2),进入redis-2.0.2目录,下面有这几个文件 文件作用: redis-server.exe:redis服务器的daemon(守护进程)启动程序; redis.conf:redis配置文件(在Config文件夹下); redis-cli.exe:...

小目标一个亿 4521

overlook:Mod 2最终项目

Webpack入门套件 克隆此仓库 没错,克隆不是分叉。 您将多次使用此存储库,但是只能分叉一次存储库。 因此,您需要执行以下操作来克隆存储库,但仍然能够将更改推送到您的存储库: 克隆此仓库。 由于您不想将您的项目命名为“ webpack-starter-kit”,因此在运行git clone时可以使用一个可选参数(用终端命令参数替换[...] ): git clone [remote-address] [what you want to name the repo] 删除默认的远程: git remote rm origin (注意git remote -v不会给您任何回报) 在GitHub上创建一个名称为[what you want to name the repo] ,以便与命名保持一致 复制您将用于克隆此存储库的地址-类似于git@github.com:... 将此远程添加

Redis-2.0.2下载地址及在windows下的安装使用教程

Redis-2.0.2下载地址及在windows下的安装使用教程

insufficient data written 错误

1. 因为流的传递大小跟实际写入的大小不一致导致。 2. 当用httppost传递流不是文件流的时候,使用 is.available()获取的值永远是0,需要把字节流通过文件的方法转成文件流。 3. 建议使用okhttps工具进行文件上传及流的上传。...

4758

ADS系列之SI&PI仿真笔记:ADS多种版本的安装、卸载&重装(一)

此系列仅作为ADS学习过程的记录,如有错误的地方还请大佬指正! 一、下载&安装 ADS软件下载&安装还算比较简单,目前接触到有两个版本:ADS2017和ADS2019。这里贴下链接,破解教程里面都有: ADS2017下载地址:https://pan.baidu.com/s/1l-Bs9owKRmp5Pv0Mt92OYA 提取码:wuzf ADS2019下载地址:吴川斌的博客-w...

Claudedy的博客 3万+

Redis安装教程(超详细)

Redis 一、Redis安装 1、windows下安装 默认端口:6379 下载连接 https://github.com/tporadowski/redis/releases 解压 双击redis-server.exe启动服务端 双击redis-cli.exe启动客户端连接服务端 在客户端输入 “ping”,出现“PONG”,即证明连接成功 2、Linux下安装 2.1、下载linux压缩包 【redis-5.0.5.tar.gz】 2.2、通过FlashFXP把压缩包

X_lsod的博客 18万+

Global Mapper与ArcGIS双剑合璧:自动化与半自动矢量化提取地物轮廓实战

本文详细介绍了如何结合Global Mapper的自动化批量提取与ArcGIS的半自动精细修整功能,高效完成地物轮廓矢量化工作。通过实战案例,阐述了利用Global Mapper快速抓取初步轮廓,再借助ArcGIS的ArcScan等工具进行精细化编辑和优化的完整工作流,有效提升地理信息数据处理效率。

weixin_29284657的博客 119

一文解读DeepSeek训练数据集

本文重点以DeepSeek为例,详细介绍预训练数据集相关内容。大语言模型LLM(如DeepSeek、ChatGPT、文心一言等)的“智慧”源于它们学习的海量数据集。简单来说,数据集就是模型的“知识库”,通常由互联网公开的文本、图片、视频等。这些数据需满足两个特点:规模大和多样性。规模大是指数据量可达千亿级词汇,让模型学习复杂规律;多样性则涵盖多领域(如科技、文学)、多语言、多形式(对话、新闻),帮助模型适应不同场景。例如,训练数据中既有百科知识,也有日常对话,模型才能既解答专业问题,又能闲聊。

u013891230的博客 7089

Windows下安装Redis

一、下载Redis 官网下载地址(Linux版本):http://www.redis.cn/download.html Windows版本下载地址:https://github.com/microsoftarchive/redis/tags 最新版本为3.2,下载最新版本的,现在电脑基本都是64位系统,本次也下载64位的。 要下载32位版本的,自己找找资源,找到了可以分享下。 二、W...

说那么多干嘛的博客 2万+

ESP32 DMX512与RDM协议栈开发指南

DMX512-A是专业灯光控制领域广泛采用的串行通信标准,基于RS-485物理层实现确定性单向数据传输;RDM(Remote Device Management)则在其基础上扩展双向、可寻址、可配置的智能管理能力,满足现代舞台设备远程固件升级、自动发现与参数配置需求。二者共用同一总线但时序与帧结构严格隔离,对硬件定时精度、中断响应延迟及电气隔离提出极高要求。在嵌入式实践中,ESP32凭借Wi-Fi/蓝牙连接能力与丰富外设资源,成为构建低成本智能DMX节点的理想平台。esp_dmx协议栈正是面向该场景的高性能

weixin_34945060的博客 316

windows下Redis安装

Windows下Redis安装

qq_45740503的博客 1万+

拆解大疆M300电池BMS:基于TI TIDA-010030方案的硬件架构深度分析

本文深度解析了大疆M300无人机电池管理系统(BMS)基于TI TIDA-010030参考设计的硬件架构。通过对比TI方案与大疆实现的差异,详细介绍了BQ7694003监控前端和BQ34Z100电量计的优化设计,以及通信架构的可靠性改进。文章还揭示了大疆在成本、空间和标准化方面的工程妥协与创新平衡,为锂电池保护方案提供了实践参考。

weixin_27066963的博客 239

vue3 web项目引入高拍仪

高拍仪的引入步骤就两步,安装SDK,然后根据官网的api进行开发。根据自己需要的功能,请求对应的接口。

qq_42480170的博客 4118

Windows 安装Redis

Redis的安装步骤

weixin_44787374的博客 1930

HQChart实战教程54:Renko砖形K线图实现详解

Renko图(砖形图)起源于日本,只关注价格变动而忽略时间和成交量因素: 2.2 算法说明 初始化:使用第一根K线的收盘价创建第一个砖块 变动检测:计算当前价格与最后一个砖块的差值 砖块生成: 当价格变动≥砖块大小时,生成新砖块 当价格变动不足时,更新当前砖块的高低价 方向判断:根据价格变动方向确定砖块颜色 三、完整实现代码 四、Renko图的高级应用 4.1 动态砖块大小调整 4.2 Renko交易策略 三砖反转策略:趋势跟踪策略:本文详细介绍了Renko图的实现原理和在HQChart中的应

QQ_778132974的博客 874

Windows 系统上安装 Redis

本文介绍了在Windows系统上安装Redis的两种方法:手动解压安装和通过Chocolatey安装。手动安装步骤包括下载解压Redis、修改配置文件、创建数据目录、启动服务并验证,适合开发者灵活配置。Chocolatey方式则更快捷但版本可能较旧。文中详细说明了配置文件redis.windows.conf的关键参数设置,如IP绑定、端口、密码认证和持久化选项,并针对常见问题如端口占用、认证失败等提供了解决方案。建议将Redis安装为系统服务实现开机自启,并给出了完整的验证方法。

魏波 2万+

YOLO项目部署:从Python脚本到Docker容器的企业级交付全流程

YOLO模型企业级Docker部署方案 核心挑战 环境一致性:解决"本地能跑,服务器崩掉"问题 可扩展性:支持单实例到多实例扩展 稳定性:确保99.9%可用性 部署流程 项目改造:模块化代码,分离配置 Docker镜像:支持CPU/GPU环境 API服务:封装推理逻辑 监控告警:实现自动化运维 技术方案 需求 解决方案 环境一致性 Docker镜像+依赖冻结 可扩展性 K8s+负载均衡 稳定性 健康检查+自动重启 项目结构 模块化代码组织 外部化配置管理 精确依赖版本控制 摘要重点:通过

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

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

Windows使用docker安装redis

有了docker,我们就可以如同用Linux一样用windows了,完美!

Peter Cheung的博客 4802

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

在Windows系统上安装和配置Redis服务

通过以上步骤,你可以在Windows系统上成功安装Redis服务,并使用RedisDesktopManager进行管理。设置密码可以增强Redis的安全性,确保只有授权用户可以访问你的Redis实例。希望这篇文章能帮助你快速上手Redis!如果你有任何问题,欢迎在评论区留言。

黄同学的博客 2276

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

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

Windows下安装Redis及使用Python操作Redis的方法

这篇文章主要介绍了Windows下安装Redis及使用Python操作Redis的方法,非常不错,具有参考借鉴价值,需要的朋友可以参考下 首先说一下在Windows下安装Redis,安装包可以在https://github.com/MSOpenTech/redis/releases中找到,可以下载msi安装文件,也可以下载zip的压缩文件。 下载zip文件之后解压,解压后是这些文件: 里面这个...

sakura379的博客 1451

Redis——Windows安装

redis-server.exe --service-install redis.windows.conf --Service-name RedisServer2 --loglevel verbose --port 6380,这样也是指定端口安装。进入Redis安装包文件下,注册服务:redis-server.exe --service-install redis.windows.conf --Service-name RedisServer1 --loglevel verbose。

embelfe_segge的博客 1849

centos与Windows下安装Redis

安装: yuminstallredis 使用配置文件启动 redis,配置文件在/etc/redis.conf redis-server/etc/redis.conf & 连接客户端 redis-cli 服务器和客户端在 /usr/bin/redis-server redis-cli whereis redis 可以查看配置文件在哪 下面附Windows...

大灰狼的专栏 5877
上一篇: mysql对于大字段的查询慢的处理
下一篇: MySQL安装未响应解决方法(转)
cd0281
博客等级 码龄23年 0粉丝 58原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值