dice

How to Build a Deep Learning Project——With Keras

前提是你 提交于 2019-11-28 02:30:15
How to Build a Deep Learning Project——With Keras Step One: Data reading For cifar10, this step is very easy, Keras has already packaged it and split it into training data and testing data. from keras . datasets import cifar10 , cifar100 ( x_train , y_train ) , ( x_test , y_test ) = cifar10 . load_data ( ) For our DIY datasets, we should read and save the pictures one by one. def get_data ( dir ) ''' Return two lists ''' images = [ ] labels = [ ] dir = 'D:/' images_files = os . listdir ( dir + '/images' ) labels_files = os . listdir ( dir + '/labels' ) for x in images_files : images . append (

Leetcode-1155 Number of Dice Rolls With Target Sum(掷骰子的N种方法)

最后都变了- 提交于 2019-11-26 22:52:09
dp[i][j]表示前i个骰子到达数字总和j的方案数 dp[i][j] = Σdp[i-1][j-k],其中k是一个骰子能掷出的范围 1 #define _for(i,a,b) for(int i = (a);i < b;i ++) 2 3 class Solution 4 { 5 public: 6 int dp[31][1003]; 7 int numRollsToTarget(int d, int f, int target) 8 { 9 _for(k,1,f+1) 10 dp[0][k] = 1; 11 _for(i,1,d) 12 _for(j,1,target+1) 13 _for(k,1,f+1) 14 { 15 if(j-k>0) 16 dp[i][j] += dp[i-1][j-k]; 17 dp[i][j] %= 1000000007; 18 } 19 return dp[d-1][target]; 20 } 21 }; 来源: https://www.cnblogs.com/Asurudo/p/11334549.html

jQuery掷骰子

岁酱吖の 提交于 2019-11-26 18:06:00
网上找的jQuery掷骰子效果,测试兼容IE7及以上浏览器,IE6没有测试 js代码如下: 1 $(function(){ 2 var dice = $("#dice"); 3 dice.click(function(){ 4 $(".wrap").append("<div id='dice_mask'></div>");//加遮罩 5 dice.attr("class","dice");//清除上次动画后的点数 6 dice.css('cursor','default'); 7 var num = Math.floor(Math.random()*6+1);//产生随机数1-6 8 dice.animate({left: '+2px'}, 100,function(){ 9 dice.addClass("dice_t"); 10 }).delay(200).animate({top:'-2px'},100,function(){ 11 dice.removeClass("dice_t").addClass("dice_s"); 12 }).delay(200).animate({opacity: 'show'},600,function(){ 13 dice.removeClass("dice_s").addClass("dice_e"); 14 }).delay(100)

掷骰子

一个人想着一个人 提交于 2019-11-26 18:05:46
   <!DOCTYPE html> <html lang="en"> <head> <title>动态图片切换</title> <meta charset="UTF-8"> <link href="css/style.css" rel="stylesheet"> </head> <body> <!-- 游戏区域 --> <div id="container"> <img src="images/dice_1.png" id="dice" alt=""> </div> <div id="command"> <input id="btn" type="button" value="摇一摇"> </div> </body> </html> <script src="../../../Day12/code/public.js"></script><!--引用js数据库,调用函数--> <script type="text/javascript"> //获取所需元素 var btn = document.getElementById("btn"); var img = document.getElementById("dice"); //给btn一个点击事件 btn.onclick = function(){ //切换img的src为动画图片 img.src = "images

V-Net

╄→гoц情女王★ 提交于 2019-11-26 04:50:31
论文地址: https://ieeexplore.ieee.org/abstract/document/7785132 项目地址: https://github.com/faustomilletari/VNet 其他项目: https://github.com/mattmacy/vnet.pytorch https://github.com/MiguelMonteiro/VNet-Tensorflow 1. 论文背景 医学图像大部分是3D Volumetric(如MRI),2D slice-by-slice 的处理方法低效、冗余,又丢失了slices之间的关联性。 2. 论文亮点 (1)直接使用3D卷积对Volumetric Medical Image进行分割; (2)使用了一种新的目标函数(Dice Loss); (3)卷积阶段学习残差函数(ResNet思想)。 3. 论文细节 3.1 网络结构 这里强调几点: (1)将网络分成若干个阶段,每个 阶段 学习残差函数,以此来加快收敛速度。 (2)如何实现降采样?This is performed through convolution with 2 × 2 × 2 voxels wide kernels applied with stride 2。注意:这里降采样不是采用Pooling,请思考为什么不采用Pooling?