自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(149)
  • 收藏
  • 关注

原创 联邦学习学习笔记——论文理解《Communication-Efficient Learning of Deep Networks from Decentralized Data》

Google — Federated Learning联邦学习Google原文:《Communication-Efficient Learning of Deep Networks from Decentralized Data》最近研读了这篇提出了联邦学习(Federated Learning)的文章,并整理了详细的笔记,内容主要是对原文的理解和整理,希望能帮助正在了解联邦学习的小伙伴们。...

2020-02-17 15:18:35 29245 12

原创 《Structuring Machine Learning Projects》《结构化机器学习项目》学习笔记(一)

《Structuring Machine Learning Projects》(《结构化机器学习项目》)1.1 为什么是ML策略?课程目标: 学习更为快捷高效地构建机器学习系统的方法什么是ML Strategy?当训练效果不好时,我们会考虑各种改善的办法。比如: 在调试一个猫分类器的时候,可能进行了一些尝试、调整了数次后,准确率是90%,对于一个应用程序来说还是不够高。那么,我们怎么...

2020-02-16 09:55:34 354

原创 【ML】线性回归——Lasso回归的一点总结

1.Lasso回归模型原模型:其中z是高斯分布噪声,z~N(0,sigma ^ 2)套索目标函数: 2.Lasso回归的效果(目的)缩小(收缩)系数,并且将其中一些置零,从而获得岭回归和最优子集选择法的共同优点参考:lasso.pdf  3.Lasso回归精度分析其中p是自变量个数,n是样本数目,s是原模型中系数不为零的beta个数,sigm...

2018-08-09 08:06:21 3860

原创 【ML】线性回归——Lasso回归与最小角回归

最近在看一下Sparse Linear Regression的内容,其中常用的方法就是Lasso回归。主要思想就是在一般的最小二乘上加一个一范数正则项,添加这个正则项之后,得到的回归系数中有些会被置为0,从而得到了一个系数的回归系数。这方面的参考很多,就不详细说明了。这里,主要要说明的是最小角回归和Lasso回归的关系与区别在许多参考资料中,都会说最小角回归是解决Lasso的一种高效方法,...

2018-08-08 10:00:30 3509 1

原创 【ML】隐马尔可夫模型(HMM)——前向后向算法(C++实现)

最近在看“统计学习方法”,第十章讲的“隐马尔可夫模型”,方法理论比较基础,但是应用很广泛。具体理论知识可以参考:https://blog.csdn.net/xmu_jupiter/article/details/50956389以下是我自己为了方便复习回顾,整理的PPT来讲解这章的内容,下面是前向后向算法: 下面是用C ++实现前向后向算法的代码://// main....

2018-07-29 16:58:44 2612

原创 【ZOJ 1003】 Crashing Balloon(DFS)

好久没有更新过了,一直看paper,看算法,这几天重新开始刷题大业,发现果然生疏了(捂脸哭PS:发现CSDN变化好大,写博客、编辑文章更人性化了。。。下面切入正题这次找了一道简单的ACM模拟题,涉及数论和dfs递归。参考:https://blog.csdn.net/axiqia/article/details/51096709   /*描述:六一儿童节,小朋友们做踩气球游戏,...

2018-07-29 14:52:54 483

原创 【HDU】1372 Knight Moves

Problem DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n sq...

2018-05-20 11:14:45 202

原创 【HDU】2614 Beat(C++/C)

Problem DescriptionZty is a man that always full of enthusiasm. He wants to solve every kind of difficulty ACM problem in the world. And he has a habit that he does not like to solvea problem that is ...

2018-05-19 12:13:02 235

原创 【HDU】1226 超级密码(C++/C)

Problem DescriptionIgnatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息:密码是一个C进制的数,并且只能由给定的M个数字构成,同时密码是一个给定十进制整数N(0<=N<=5000)的正整数倍(如果存在多个满足条件的数,那么最小的那个就是密码),如果这样的密码存在,那么当你输入它以...

2018-05-18 09:53:51 486

原创 【HDU】2209 翻纸牌游戏(C/C++)

Problem Description有一种纸牌游戏,很有意思,给你N张纸牌,一字排开,纸牌有正反两面,开始的纸牌可能是一种乱的状态(有些朝正,有些朝反),现在你需要整理这些纸牌。但是麻烦的是,每当你翻一张纸牌(由正翻到反,或者有反翻到正)时,他左右两张纸牌(最左边和最右边的纸牌,只会影响附近一张)也必须跟着翻动,现在给你一个乱的状态,问你能否把他们整理好,使得每张纸牌都正面朝上,如果可以,最少需...

2018-05-17 20:46:10 2527

原创 【HDU】2514 Another Eight Puzzle(C++/C)

Problem DescriptionFill the following 8 circles with digits 1~8,with each number exactly once . Conntcted circles cannot be filled with two consecutive numbers.There are 17 pairs of connected cicles:A...

2018-05-17 16:28:10 178

原创 【HDU】1728 逃离迷宫(C++/C)

Problem Description  给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感的人,因此,她在行走过程中,不能...

2018-05-17 14:42:44 1523

原创 【HDU】1269 迷宫城堡(C++)

Problem Description为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。Gardon需要请你写个程序确认一下是否任意两个房间都是相互连通的,即:对于任意的i和j,...

2018-05-16 20:29:29 903

原创 【LeetCode】108. Convert Sorted Array to Binary Search Tree(C++)

Given an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the t...

2018-05-14 22:11:06 222

原创 【LeetCode】733. Flood Fill (C++)

An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535).Given a coordinate (sr, sc) representing the starting pixel (row and column...

2018-05-14 21:19:17 529

原创 【LeetCode】100. Same Tree

Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.Example 1:In...

2018-05-14 20:47:43 130

原创 【LeetCode】690 Employee Importance(C++)

You are given a data structure of employee information, which includes the employee's unique id, his importance value and his directsubordinates' id.For example, employee 1 is the leader of employee 2...

2018-05-14 20:23:30 202

原创 【LeetCode】695. Max Area of Island

题目:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are sur...

2018-05-11 16:38:28 129

原创 【LeetCode】226. Invert Binary Tree(C++)

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1这道题我是用递归求解的,代码如下:代码:(递归)/** * Definition for a binary tree node. * struct TreeN...

2018-05-07 22:02:01 174

原创 【LeetCode】104. Maximum Depth of Binary Tree(C++)

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Note: A leaf is a node with no children.Ex...

2018-05-07 21:24:19 127

原创 【LeetCode】260. Single Number III(C++)

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given nums = [1,...

2018-05-06 11:51:17 231

原创 【LeetCode】137. Single Number II(C++)

Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one.Note:Your algorithm should have a linear runtime complexity. Cou...

2018-05-06 10:51:34 263

原创 【LeetCode】136 Single Number(C++)

Given a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using ...

2018-05-06 10:10:20 189

原创 【LeetCode】Merge Two Binary Trees(C++)

Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tree. ...

2018-05-05 22:06:51 222

原创 【LeetCode】 Hamming Distance (C++)

The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note:0 ≤ x, y < 231.Exa...

2018-05-05 21:33:10 197

原创 【LeetCode】Merge Two Sorted Lists(C++)

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1->3->4Output: 1->1...

2018-05-05 20:34:04 133

原创 【LeetCode】Valid Parentheses(C++)

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of brack...

2018-05-05 17:21:44 269

原创 【LeetCode】Two Sum (C++)

最近花了点时间了解了下C++,感觉与C还是有很多不同的。接下来坚持每天用C++写五道LeetCode。fighting!题目:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input w...

2018-05-05 16:50:00 102

原创 【C++】 生成随机数

#include <iostream>#include<stdio.h>#include<time.h>#define random(x)(rand()%x)using namespace std;int main(){ srand((int)time(0));//部署随机种子 for (int i = 0; i < 10; ...

2018-04-24 15:40:11 143

原创 【POJ】1979 Black and Red(DFS)

Red and BlackTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 41057 Accepted: 22269DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black....

2018-04-19 22:05:16 144

原创 【POJ】1321(DFS——棋盘问题)

棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 59850 Accepted: 28687Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输...

2018-04-19 22:00:56 114

原创 DFS——拯救OIBH总部

拯救OIBH总部(来源于http://acm.qust.edu.cn/problem.php?id=1101)OIBH被突来的洪水淹没了> .< 还好OIBH总部有在某些重要的地方起一些围墙,用*号表示,而一个封闭的*号区域洪水是进不去的……现在给出OIBH的围墙建设图,问OIBH总部没被淹到的重要区域(由" 0" 表示)有多少。输入第一行是两个数,x和y(x,y< =500) ...

2018-04-19 18:57:33 750

原创 DFS——细胞问题

题目:1009: 细胞Description一矩形阵列由数字0到9组成,数字1到9代表细胞。细胞的定义为沿细胞数字上下左右还是细胞数字则为同一细胞。求给定矩形阵列的细胞个数。如阵列  4  100234500067103456050020456006710000000089有4个细胞。Input第一行包含2个整数n和m,分别表示矩形阵列的行数和列数。接下来的n行,每行m个数字,代表细胞的矩形阵列。...

2018-04-16 11:46:53 1768

原创 【POJ】1562 Oil Deposits(DFS)

DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that...

2018-04-16 10:44:34 143

原创 【HDU】1016 DFS——Prime Ring Problem

Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Not...

2018-04-15 16:14:57 140

原创 【HDU】2016 数据的交换输出

Problem Description输入n(n<100)个数,找出其中最小的数,将它与最前面的数交换后输出这些数。 Input输入数据有多组,每组占一行,每行的开始是一个整数n,表示这个测试实例的数值的个数,跟着就是n个整数。n=0表示输入的结束,不做处理。 Output对于每组输入数据,输出交换后的数列,每组输出占一行。Sample Input4 2 1 3 45 5 4 3 2 1...

2018-04-15 15:02:31 160

原创 【HDU】2015 偶数求和

Problem Description有一个长度为n(n<=100)的数列,该数列定义为从2开始的递增有序偶数,现在要求你按照顺序每m个数求出一个平均值,如果最后不足m个,则以实际数量求平均值。编程输出该平均值序列。 Input输入数据有多组,每组占一行,包含两个正整数n和m,n和m的含义如上所述。Output对于每组输入数据,输出一个平均值序列,每组输出占一行。 Sample Input3...

2018-04-15 14:33:29 175

原创 DFS——八个皇后—N个皇后的总结

1.八个皇后(指定n=8),输出所有可能摆放的个数代码://// main.cpp// DFS——八个皇后自己写//// Created by showlo on 2018/4/14.// Copyright © 2018年 showlo. All rights reserved.//#include <stdio.h>#include <math.h&...

2018-04-14 22:12:27 213

原创 DFS——求1—N所有数字的全排列

代码://// main.cpp// DFS——全排列//// Created by showlo on 2018/4/14.// Copyright © 2018年 showlo. All rights reserved.//输出从1到N的全排列#include <stdio.h>#include <algorithm>#include &lt...

2018-04-14 22:08:49 927

原创 DFS——迷宫问题(输出搜索过程及路径长度)

题目与上一篇BFS是一样的,这里用DFS实现是为了探究二者遍历的区别。DFS代码://// main.cpp// DFS(迷宫问题自己写)可输出搜索过程//// Created by showlo on 2018/4/14.// Copyright © 2018年 showlo. All rights reserved.//#include <stdio.h>...

2018-04-14 10:46:35 1528

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除