实用的CSS片段(转)

最新打赏系统打赏源码麒麟最新打赏源码喜盈门打赏知识付费课程教程直播讲解 打赏源码打赏系统 阅读详情

1、垂直对齐

如果你用 CSS,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用 CSS3 的 Transform,可以很优雅的解决这个困惑:

.verticalcenter{
    position: relative;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
}

使用这个技巧,从单行文本、段落到box,都会垂直对齐。目前浏览器对 Transform 的支持是需要关注的,
Chrome 4 , Opera 10 , Safari 3 , Firefox 3 , and Internet Explorer 9均支持该属性


2、背景渐变动画

button{
        padding: 10px 20px;
        top: 50px;
        left: 50px;
        border: none;
        border-radius: 4px;
        color: #fff;
        font: 16px sans-serif;

        background-image: linear-gradient(#36d279, #1d854a);
        background-size: auto 200%;
        background-position: 0 100%;
        transition: background-position .5s;
        cursor: pointer;
    }
button:hover{
        /*改变渐变色显示位置*/
        background-position: 0 0;
    }

3、CSS:表格列宽自适用

对于表格,当谈到调整列宽时,是比较痛苦的。然后,这里有一个可以使用的技巧:给 td 元素添加 white-space: nowrap; 能让文本正确的换行

td {
    white-space: nowrap;
}

4、制造模糊文本

想要让文本模糊?可以使用color透明和text-shadow实现

.blurry-text {
   font-size: 28px;
   font-family: arial;
   font-weight:bold;
   color: transparent;
   text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

5、用CSS动画实现省略号动画

这个片段将帮助你制造一个 ellipsis 的动画,对于简单的加载状态是很有用的,而不用去使用 gif .

<div class="loading">Loading</div>
.loading:after {
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom;
    -webkit-animation: ellipsis 2s infinite;
    -moz-animation: ellipsis 2s infinite;
    animation: ellipsis 2s infinite;
    content: "\2026"; 
}
@-moz-keyframes ellipsis {
    from {
        width: 2px;
    }
    to {
        width: 15px;
    }
}
@-moz-keyframes ellipsis {
  from {
    width: 2px;
  }
  to {
    width: 15px;
  }
}

@-webkit-keyframes ellipsis {
  from {
    width: 2px;
  }
  to {
    width: 15px;
  }
}

6、样式重置

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  outline: none;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
html { height: 101%; }
body { font-size: 62.5%; line-height: 1; font-family: Arial, Tahoma, sans-serif; }
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
strong { font-weight: bold; } 
table { border-collapse: collapse; border-spacing: 0; }
img { border: 0; max-width: 100%; }
p { font-size: 1.2em; line-height: 1.0em; color: #333; }

7、CSS清除浮动

.clearfix:before, .container:after { content: ""; display: table; }
.clearfix:after { clear: both; }
/* IE 6/7 */
.clearfix { zoom: 1; }

8、通用媒体查询

/* Smartphones (portrait and landscape) ----------- */
@media only screen 
and (min-device-width : 320px) and (max-device-width : 480px) {
  /* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
  /* Styles */
}
/* Smartphones (portrait) ----------- */
@media only screen and (max-width : 320px) {
  /* Styles */
}
/* iPads (portrait and landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
  /* Styles */
}
/* iPads (landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {
  /* Styles */
}
/* iPads (portrait) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
  /* Styles */
}
/* Desktops and laptops ----------- */
@media only screen and (min-width : 1224px) {
  /* Styles */
}
/* Large screens ----------- */
@media only screen and (min-width : 1824px) {
  /* Styles */
}
/* iPhone 4 ----------- */
@media only screen and (-webkit-min-device-pixel-ratio:1.5), only screen and (min-device-pixel-ratio:1.5) {
  /* Styles */
}

9、CSS3 盒阴影

-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.52);
        -moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.52);
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.52);

10、CSS3 鲜艳的输入

input[type=text], textarea {
    -webkit-transition: all 0.30s ease-in-out;
    -moz-transition: all 0.30s ease-in-out;
    -ms-transition: all 0.30s ease-in-out;
    -o-transition: all 0.30s ease-in-out;
    outline: none;
    padding: 3px 0px 3px 3px;
    margin: 5px 1px 3px 0px;
    border: 1px solid #ddd;
}
input[type=text]:focus, textarea:focus {
    box-shadow: 0 0 5px rgba(81, 203, 238, 1);
    padding: 3px 0px 3px 3px;
    margin: 5px 1px 3px 0px;
    border: 1px solid rgba(81, 203, 238, 1);
}

11、css3制作箭头

<span class="cool"></span>

.cool{
  padding-right: 13px;
  position: relative;
}
.cool:after{
  content:" ";
  display:inline-block;
  height:6px;
  width:6px;
  border-width: 2px 0 0 2px;//左箭头
  //border-width:2px 2px 0 0;//右箭头
  //border-width:0 2px 2px 0;//下箭头
  //border-width: 0 0 2px 2px;//左箭头
  border-color:#C8C8CD;
  border-style:solid;
  -webkit-transform:matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
          transform:matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  position:relative;
  top:-2px;
  position:absolute;
  top:50%;
  margin-top:-4px;
  right:2px;
}

12、文字两端对齐,after 伪装多行,利用 text-align:justify

<!doctype html> 
    <html lang="en"> 
        <head>
            <meta charset="UTF-8">
            <meta name="Keywords" content="关键词">  
            <meta name="Description" content="描述">  
            <title>两端对齐</title>  
            <style>
            *{margin:0px;padding:0px;}/*去除默认外边距、内边距*/ 

            div{width:800px;height:100px;border:2px solid red;margin:auto;}  

            span{text-align:justify;width:100%;}  

            span:after{  
                content:"";  
                display:inline-block;  
                width:100%;  
                /*原理:after伪类是在被选元素的内容后面插入内容,此处当给p标签一个after给p标签添加一个宽度为p标签的宽度的100%后就自动压缩到下一行显示,前面的内容就自动两端拉伸,自动对齐,如果要看清after伪类后的显示情况就设定一个高度,否则高度不设定自动为零*/  

                /*height:20px;       
                background:red;*/  
            }  
            span{/*list-style:none;*/display:inline-block;}  
            </style>  
        </head>  
        <body>
            <div>  
                <p>  
                    <!-- <span>首页</span>  
                    <span>一号店</span>  
                    <span>手机</span>  -->
                    <span>这样就能两端对齐!</span>
                </p>  
            </div>  
        </body>  
    </html>  



13、双飞燕布局

<template>
<header>header</header>
<section class="wrapper">
    <section class="col main">
        <section class="main-wrap">main</section>
    </section>
    <aside class="col left">left</aside>
    <aside class="col right">right</aside>
</section>
<footer>footer</footer>
</template>

<style>
/* 以下为简码,仅保留关键部分 */
header,footer {height: 50px;}
.wrapper {padding: 0; overflow:hidden;}
.col {float: left;}
.main {width: 100%;}
.main-wrap {margin: 0 100px 0 100px;height: 200px;}
.left {width: 100px; height: 200px; margin-left: -100%;}
.right {width: 100px; height: 200px; margin-left: -100px;}
</style>
Android Input——输入系统介绍(一) Input 系统对于提供流畅、灵敏和一致的用户交互体验至关重要,它需要在不同的设备、场景和应用中保证输入事件的正确性、及时性和安全性。Android 输入系统是一个复杂但高效的设计,旨在处理来自各种输入设备(如触摸屏、键盘等)的用户交互,并将这些交互转换为应用程序可以理解和响应的形式。EventHub:输入系统的最底层,直接与硬件通信,监听和读取输入设备的原始事件。:从 EventHub 获取原始输入事件,对其进行解析,转化为更高层次的事件,以便上层应用或服务能够理解。 阅读详情

相关推荐

脆弱的冗余:链路聚合(LACP)中单条链路故障引发的网络震荡

show etherchannel summary# 查看聚合组中所有端口的标志位,健康状态应为 ‘P’ (Port-channel) 或 ‘SU’(Stand-up)。本次故障的核心教训是:网络系统对“部分故障”的容忍度和自愈能力,远比应对“完全故障”要重要和复杂得多。3.加强监控:部署网管系统,监控聚合端口的包错误计数、LACP状态变化频率,并设置阈值告警。标签: #链路聚合 #LACP故障 #网络冗余 #排障案例 #网络高可用性。修复链路:更换光模块、清洁光纤接口、检查物理线路。

danyth的博客 1983

实用的60个CSS代码片段[转]

1、垂直对齐 如果你用CSS,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用CSS3的Transform,可以很优雅的解决这个困惑: .verticalcenter{ position: relative; top: 50%; -webkit-transform: translateY(-50%); -o-transform: translateY(

splendid_can的博客 692

移远EC20模块USB模式切换的底层逻辑与驱动适配探秘

本文深入探讨了移远EC20模块USB模式切换的底层逻辑与驱动适配机制,详细解析了AT命令控制下的USB0与WWAN0模式差异。通过分析USB协议栈、内核驱动框架及网络子系统的交互,提供了模式切换的完整操作流程和常见问题解决方案,助力开发者优化4G通信模块在嵌入式设备中的稳定连接。

cc789的博客 843

实用的60个CSS代码片段[转] 博客链接:http://blog.poetries.top

1、垂直对齐 如果你用CSS,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用CSS3的Transform,可以很优雅的解决这个困惑: .verticalcenter{ position: relative; top: 50%; -webkit-transform: translateY(-50%); -o-transform: translate

Frankywls的博客 3530

STM32F103模拟SSI时序解析:实现高精度绝对式编码器位置读取

本文详细解析了如何在STM32F103微控制器上通过软件模拟SSI协议时序,实现高精度绝对式编码器的位置读取。文章从项目驱动出发,深入剖析了SSI通信原理、硬件电平转换连接、核心软件模拟代码实现及关键时序参数调试方法,并提供了使用示波器进行波形对齐与优化的实战指南,为成本敏感型工业控制与机器人项目提供了高性价比的解决方案。

weixin_29196315的博客 141

基于Gardner环的QPSK定时同步MATLAB仿真:四倍采样与多场景性能分析

本文详细介绍了基于Gardner环的QPSK定时同步MATLAB仿真方法,重点分析了四倍采样技术在定时同步中的应用与性能优化。通过MATLAB代码实例展示了Gardner环的实现原理、多场景性能分析及常见问题解决方案,为数字通信系统的定时同步设计提供实用参考。

weixin_29083475的博客 373

记录--N 个值得一看的前端代码片段

在日常的开发过程中,我们都会有一些常用的代码片段,这些代码片段可以直接复制到各个项目中使用,非常方便。如果你有接手过别人的项目,就可以很明显感受到几个项目一般都会有一些相同的工具类方法,这些方法就是之前开发者的常用代码片段。

林恒的博客 145

Deepfake检测模型-PyDeepFakeDet项目复现实验报告-深度学习

该实验是对于https://github.com/wangjk666/PyDeepFakeDet模型的复现。PyDeepFakeDet 是一款集成的、可扩展的 Deepfake 检测工具。目标是提供最先进的 Deepfake 检测模型以及用于在常用 Deepfake 数据集上训练和评估新模型的接口。

一位不是很硕的鉴伪方向硕士 5494

7个超实用Obsidian CSS片段:从安装到美化全流程

你还在为Obsidian默认界面单调而烦恼?想让笔记系统既实用又赏心悦目?本文将带你掌握7个精选CSS片段的安装与应用,无需编程基础,10分钟即可让你的Obsidian焕然一新。读完你将学会:侧边栏自动隐藏、复选框美化、图片悬停放大等实用技巧,并获取所有片段的一键下载链接。 ## 什么是CSS片段 CSS(层叠样式表)片段是Obsidian的个性化工具,可修改界面元素的外观和交互方式。所有片段...

gitblog_00714的博客 833

【知识分享】什么是同轴传输线结构?

同轴传输线的几何形状由中心导体组,嵌在介电材料(Dielectric)中,并且,被连续的外导体所包围,也被称为屏蔽(Shield)。内外导体有相同的几何中心轴,因此得名同轴(Coaxial)。

一只豌豆象的博客 2372

SSD |(二)SSD主控

控制器作为一个片上系统,处理来自用户端的命令并负责管理闪存颗粒。

知识库搭建ing 1959

20个超实用的Obsidian CSS片段:动态效果演示与安装教程

想要让Obsidian笔记软件界面更加美观和实用吗?awesome-obsidian项目提供了20个精心设计的CSS片段,这些CSS代码片段可以轻松定制你的Obsidian界面,从优雅的自动淡出效果到实用的媒体网格布局,应有尽有。作为一款强大的知识管理工具,Obsidian通过CSS自定义功能让用户能够完全控制界面外观和交互体验。 ## 🎯 为什么需要CSS片段? CSS片段是Obsidia

gitblog_00776的博客 402

docker安装部署openclaw详细教程(安装、卸载、问题处理)

摘要: 本文详细介绍了使用Docker部署OpenClaw本地AI智能体框架的全流程,包括代码下载、容器化安装、交互式配置及Token设置。Docker方案解决了环境配置复杂、依赖冲突等痛点,提供开箱即用的隔离环境。教程涵盖常见错误(如EACCES权限问题、网关启动失败、设备配对需求)的解决方案,并提供了完整的卸载指南。通过Docker部署,用户可快速构建安全、一致的AI智能体开发环境,实现大模型与本地工具的高效连接。

少说,多做 4003

60个非常实用的CSS代码片段,千万要收藏好了!

来源 | http://blog.poetries.top/2016/08/13/%E5%AE%9E%E7%94%A8%E7%9A%8460%E4%B8%AACSS%E4%BB%A3%E7%A0%81%E7%89%87%E6%AE%B5/ 1、垂直对齐如果你用CSS,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用CSS3的Transform,可以很优雅的解决这个困惑:.verticalce...

职业搬砖 2590

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

60个非常实用的CSS代码片段,推荐收藏

快捷目录垂直对齐伸展一个元素到窗口高度基于文件格式使用不同的样式创建跨浏览器的图像灰度背景渐变动画CSS:表格列宽自适用只在一边或两边显示盒子阴影包裹长文本制造模糊文本样式重置典型的CSS清除浮动新版清除浮动(2011)跨浏览器的透明CSS引用模板个性圆角通用媒体查询现代字体栈自定义文本选择为logo隐藏H1图片边框偏光锚链接伪类奇特的CSS引用CSS3:全屏背景内容垂直居中强制出现垂直滚动条CSS3渐变模板@font-face模板缝合CSS3元素CSS3 斑马线31、有趣的&大字段落内部CSS3

Silvia 1万+

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

不常见却非常实用的css片段

非常实用的css片段

how2js的博客 187

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

50个常用的CSS2/CSS3代码片段

这篇文字里我会介绍50 个便于使用的 CSS2/CSS3 代码片段给所有的WEB专业人员. 选择IDE开发环境来存储这些是个不错选择, 或者仅仅是把它们保存为一个小小的CSS文件. 不管那种方式我肯定设计者和开发者都会发现他们之中一些有用的. 推荐阅读:对初学者的 20个有用的CSS技巧 1. CSS 重置 html, body, div, span, applet, o...

qq_27628085的博客 896

Obsidian终极美化指南:从基础到高级的CSS片段应用

还在为Obsidian笔记应用的默认界面感到单调乏味吗?想要打造一个既美观又高效的个性化知识管理系统吗?本文为你带来完整的Obsidian美化教程,从基础设置到高级定制,让你的笔记体验焕然一新。 ## 为什么选择CSS片段美化Obsidian? Obsidian作为一款强大的本地笔记应用,其最大的优势之一就是高度可定制性。通过简单的CSS代码片段,你无需掌握复杂的编程知识,就能轻松实现界面优化

gitblog_00064的博客 1453

10个超实用Obsidian CSS片段技巧:打造高颜值笔记系统

Obsidian作为一款强大的本地笔记应用,通过CSS片段可以深度定制界面样式,提升笔记视觉效果与工作效率。本文精选10个实用CSS片段,帮助新手用户轻松美化Obsidian界面,打造个性化的笔记体验。 ## 一、什么是Obsidian CSS片段? CSS片段是Obsidian的高级自定义功能,通过编写或导入CSS代码,可以修改界面元素样式。所有CSS片段都存放在项目的`code/css-s

gitblog_00774的博客 1010

60个非常实用的CSS代码片段

转载地址:http://blog.poetries.top/2016/08/13/%E5%AE%9E%E7%94%A8%E7%9A%8460%E4%B8%AACSS%E4%BB%A3%E7%A0%81%E7%89%87%E6%AE%B5/ 1、垂直对齐 如果你用CSS,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用CSS3的Transform,可以很优雅的解决这个困惑: .verti...

hellosnowyy 844

46个实用的CSS代码片段,还不来看看

垂直对齐 如果你用CSS,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用CSS3的Transform,可以很优雅的解决这个困惑: .verticalcenter{ position: relative; top: 50%; -webkit-transform: translateY(-50%); -o-transform: translateY(-50%); transform: translateY(-50%); } 使用这个技巧,从单行文本、段落到box

W Y L 268

【亲测免费】 Obsidian 笔记本主题 CSS 片段教程

Obsidian 笔记本主题 CSS 片段教程 项目介绍 Obsidian 笔记本主题 CSS 片段 是一个集合项目,由 CyanVoxel 维护,旨在为 Obsidian 用户提供一系列模仿真实笔记本页面风格的 CSS 主题小片段。这些 CSS 类设计用于增强笔记的视觉体验,让用户能够通过简单的配置,享受到个性化且接近纸质笔记本的视觉效果。支持自定义颜色变量,添加新类及组合,甚至可以对笔记中的图...

gitblog_01095的博客 807

让Obsidian颜值飙升:5个必备CSS代码片段完全指南

你是否也曾觉得Obsidian编辑器界面单调乏味?复选框呆板无趣?列表层级混乱不清?本文精选5个实用CSS代码片段,无需编程基础,3分钟即可让你的笔记界面焕然一新。通过简单复制粘贴,你将获得高颜值复选框、清晰的列表关系线、自动隐藏的简洁UI等专业级美化效果。 ## 为什么选择CSS代码片段 Obsidian作为一款本地优先的Markdown编辑器(Markdown,一种轻量级标记语言),允许用...

gitblog_00822的博客 1452

lightweight-charts 从 v3 迁移到 v4 完全指南:API 破坏性变更对照与迁移实战

> 本文基于 lightweight-charts 仓库官方迁移文档 [from-v3-to-v4.md](https://link.gitcode.com/i/dfc552d848b2773302683b7658a64754),系统梳理 v3 → v4 的全部破坏性变更(breaking changes),逐一给出"旧写法 → 新写法"的对照示例,并结合仓库源码([src/api](https:

gitblog_00021的博客 476

3分钟掌握Obsidian美化:CSS代码片段终极指南

还在使用默认的Obsidian界面吗?想要让你的知识管理工具既美观又高效吗?awesome-obsidian项目为你提供了丰富的Obsidian美化资源,通过简单的CSS代码片段,只需3分钟就能彻底改变你的Obsidian使用体验。无论你是新手还是资深用户,这些精心设计的样式都能让你的笔记界面焕然一新。 **Obsidian美化**不仅仅是外观的改变,更是工作效率的提升。通过CSS代码片段的巧妙

gitblog_00149的博客 718
上一篇: 从需求管理到产品开发流程,硅谷产品方法论大揭秘
下一篇: 前端框架Vue(1)——vue(脚手架) 推荐开发环境(转)
JesusAllen30
博客等级 码龄11年 225粉丝 53原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值