自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 C++ 语言记

这里写自定义目录标题C语言杂记动态生成二维数组C语言杂记动态生成二维数组// 生成一个mxn的矩阵int **B, *Bstorage, i;Bstorage = (int *)malloc(m * n * sizeof(int));B = (int **) malloc(m * sizeof(int *));for (i = 0; i < m; i++) B[i] = &Bstorage[i*n];...

2020-05-10 11:04:54 385

原创 Item 11: Handle assignment to self inoperator=

在使用=是,我们可能遇到以下这种自己赋值给自己的情况class Widget{---};Widget w;...w = w;假定我们对=有以下的实现class Bitmap {...};class Widget{...Widget& operator=(const Widget& rhs) { delete pb; pb = new Bitmap(*rhs.pb); return *this;}private: Bitmap *pb;};以上实现在遇

2021-06-26 18:02:22 140

原创 Item 10: Have assignment operators return a reference to *this

int x, y, z;x = y = z = 15;在c++中=是右结合(right-associative),所以可以按以上方式进行链式的使用。为了支持以上方式,我们自己所写的数据类型需要按以下方式进行实现class Widget{public: Widget& opoerator=(const Widget& rhs) { ... return *this; } Widget& opoerator+=(const Widget& rhs) {

2021-06-26 17:36:53 111

原创 Iterm3: Use const whenever possible

首先,我们介绍下const使用上的语法,如下/* * @Brief: file description * @Author: liudy * @Email: [email protected] * @Date: 2021-06-26 16:32:33 * @LastEditors: liudy * @LastEditTime: 2021-06-26 16:41:20 */#include <iostream>using namespace std;int main

2021-06-26 17:06:16 275

原创 Item 2:Prefer consts, enums, and inlines to #defines

这个条款我们同样可以理解为 “prefer the compiler to the preprocesor”#define Accelerate_Rate 1.653使用#define不好的地方在于,编译器更本“看不见”符号Accelerate_Rate,因为在预编译期间代码中所有Accelerate_Rate都已经替换成了1.653。这会导致之后代码出现问题Debug的时候,出错信息只会提示1.653,这可能会导致你debug的困扰。所以使用const可能会是更好的选择const double

2021-06-26 12:20:21 88

原创 Item 9: Never call virtual functions during construction or destruction

Effective C++Item 9: Never call virtual functions during construction or destructionItem 9: Never call virtual functions during construction or destruction/* * @Brief: Effective c++ item 9 * @Author: liudy * @Email: [email protected] * @Date: 202

2021-06-24 23:04:27 111

原创 Ubuntu初始配置

安装必要软件开发环境sudo apt install build-essential必要软件sudo apt install hugo vim emacs ubuntu-gnome-desktop

2021-04-06 10:17:10 97

原创 120. 三角形最小路径和

给定一个三角形 triangle ,找出自顶向下的最小路径和。每一步只能移动到下一行中相邻的结点上。相邻的结点 在这里指的是 下标 与 上一层结点下标 相同或者等于 上一层结点下标 + 1 的两个结点。也就是说,如果正位于当前行的下标 i ,那么下一步可以移动到下一行的下标 i 或 i + 1 。示例 1:输入:triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]输出:11解释:如下面简图所示: 2 3 4 6 5 74 1 8 3自顶向下的最小路径和

2021-03-13 13:51:51 117

原创 Hugo使用

添加MathJax支持添加layouts/partials/mathjax.html文件<script type="text/javascript" async src="https://cdn.bootcss.com/mathjax/2.7.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML">MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\

2020-08-06 11:09:09 260

原创 doxygen C++

doxygen C++注释console.h:/** @file console.h * @brief Function prototypes for the console driver. * * This contains the prototypes for the console * driver and eventually any macros, constants, * or global variables you will need. * * @author H

2020-07-14 14:45:48 924

原创 Ubuntu 记

查找进程ps aux | grep privoxy

2020-07-09 11:19:00 138

原创 Highly Scalable Deep Learning Training System with Mixed-Precision: Training ImageNet in Four Minute

背景Challenge 1: Larger mini-batch size often leads to lower test accuracy, as there exists a generalization gap [^p9].Challenge 2: When using large clusters, it is harder to achieve near-linear scal...

2020-03-08 11:20:00 367

原创 interview 知识点

C++ 知识点内联函数inlineinline 和 宏定义#define的作用基本类似,都是替换或者展开。 在程序编译阶段,如果遇到内联函数,则将内联函数的实现在当前位置展开。内联的目的是为了减少函数的调用开销,从而提高运行效率,但会增加代码体量。内联函数的优缺点优点:(1)通过避免函数的回调,加速了程序的执行;(2) 通过利用指令缓存,增强局部访问性;(3)使用内联可以替换重复...

2020-02-13 11:58:47 499

原创 Use Beamer

空格\hspace{1cm}\hfill\vspace{1cm}\vfill

2019-06-13 16:04:27 210

原创 Pytorch

一机多卡 数据并行# 假设就一个数据data = torch.rand([16, 10, 5])# 前向计算要求数据都放进GPU0里面# device = torch.device('cuda:0')# data = data.to(device)data = data.cuda()# 将网络同步到多个GPU中model_p = torch.nn.DataParalle(m...

2019-05-12 08:31:06 191

原创 24点游戏

题目描述给出4个1-10的数字,通过加减乘除,得到数字为24就算胜利输入:4个1-10的数字。[数字允许重复,但每个数字仅允许使用一次,测试用例保证无异常数字]输出:true or false输入描述:输入4个int整数输出描述:返回能否得到24点,能输出true,不能输出false示例1输入7 2 1 10输出true解题代码:#include <ios...

2019-05-12 08:28:50 304

原创 Chainer use note

estimate array is in GPU or CPUfrom chainer import backendimport chainerimport numpy as npa = chaienr.as_variable(np.ones(shape=(2,2)))xp = backend.get_array_module(a)if xp.__name__ == 'numpy'...

2019-05-07 21:55:49 205

原创 Python Note

argparse useimport argparseimport sysdef check_arg(args=None): parser = argparse.ArgumentParser(description='Script to learn basic argparse') parser.add_argument('-H', '--host', ...

2019-05-07 09:31:14 238

原创 plotly 画图使用

jupyter 上使用import plotly.plotly as pyimport plotly.graph_objs as gopy.sign_in('用户名', 'API Key') #https://plot.ly 网站上注册获得trace = go.Bar(x=[1, 2], y =[1,2])data = [trace]py.iplot(data)...

2019-04-03 19:19:34 1015 2

原创 使用socket 在机器间传输numpy

# server.pyimport socketserverimport pickleimport structimport sysserver_info = ("192.168.1.153", 9999)class MyTCPHandler(socketserver.BaseRequestHandler): def handle(self): # Receiv...

2019-03-19 21:31:21 2822

原创 spacemacs org 使用

Plain listTableTODO items*** TODO write letter* organize party [33%]** TODO call people [0/2]*** TODO Peter*** TODO sarah** TODO Buy food** DONE talk to neighbor CLOSED: [2019-0...

2019-03-19 17:23:10 813

原创 Used library or tools

RPyCRPyC (pronounced as are-pie-see), or Remote Python Call, is a transparent python library for symmetrical remote procedure calls, clustering and distributed-computing. RPyC makes use of object-pr...

2019-03-18 15:54:03 259

原创 Ubuntu 使用过程中遇过的问题

okular 打印pdf文件无反应只需在打印设置里面,勾选Force rasterization 即可

2019-03-12 09:48:51 211

原创 Docker使用

Docker和宿主机之间共享文件docker run -it -v /home/haha/下载:/share microsoft/dotnet:latest /bin/bash#把宿主机的/home/haha/下载目录挂载到microsoft/dotnet:latest容器的/share目录下。...

2019-03-05 10:09:12 139

原创 screen配置

screen 使用zsh做为默认终端添加shell &amp;amp;quot;/usr/bin/zsh&amp;amp;quot;到~/.screenrc

2019-02-20 10:49:38 966

原创 zsh

sudo apt install zsh#install ohmyzsh sh -c &quot;$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)&quot;#instal themegit clone https://github.com/bhilburn/power...

2019-02-19 22:04:51 296

原创 python 配置问题

pip Import Error:cannot import name main解决方法:sudo gedit /usr/bin/pip将from pip import mainif __name__ == '__main__': sys.exit(main())改为from pip import __main__if __name__ == '__main__': ...

2019-02-19 21:22:03 194

原创 sh programming example

#!/bin/bashfor dir in `ls train/`do n=0 m=128 for img in `ls train/${dir}` do let &quot;n++&quot; cp &quot;./train/${dir}/${img}&quot; &quot;small/${dir}/${img}&quot; if test $[n] -

2019-01-16 14:21:51 203

原创 Markdown notes

# &amp;amp;lt;div align=&amp;quot;center&amp;quot;&amp;amp;gt;**Machine Learning Exercise **&amp;amp;lt;/div&amp;amp;gt;&amp;amp;lt;div align=&amp;quot;center&amp;quot;&amp;amp;gt; &amp;amp;lt;div style=&am

2018-11-02 16:18:49 209

原创 tensorflow_tips

tensorflow tipstensor实现不是直接采用数组形式,是对运算结果的引用没有真正保存数字,保存的是如何得到这些数字的运算过程属性: name shape type变量是特殊的张量tensor function get_shape tf.assign(w1, w2, validate_shape=False) //赋值改变张量维度Coll...

2018-06-20 15:10:04 210

原创 Android studio 使用中的问题

gradle 的代理配置问题(gradle sync会出现pom文件下载不成功的问题) 由于gradle不能使用socks代理所以采用Privoxy 进行https代理socks, privoxy(linux) 使用:编辑配置文件/etc/privoxy/config forward-socks5t / 127.0.0.1:1080 .listen-...

2018-06-01 17:19:07 189

原创 Capsule Network

These capsules are particularly good at handling different types of visual stimulus and encoding things like pose (position, size, orientation), deformation, velocity, albedo, hue, texture etc.Capsu...

2018-05-27 11:09:49 248

原创 awesome library

Keras: 基于 Python 的深度学习库 Keras 是一个用 Python 编写的高级神经网络 API,它能够以 TensorFlow, CNTK, 或者 Theano 作为后端运行。Keras 的开发重点是支持快速的实验。能够以最小的时延把你的想法转换为实验结果,是做好研究的关键...

2018-05-22 15:48:30 169

原创 Docker

docker image ls : list images docker pull 地址/仓库名/标签 : 获取镜像 docker image rm imagename : remove images docker history imagename : view historyThe Basic commands + docker run -h hostname...

2018-05-21 10:36:33 271

原创 python matplotlib 简单使用

Annotation 标注 x0 = 1 y0 = 2*x0 + 1 plt.plot([x0, x0,], [0, y0,], 'k--', linewidth=2.5) plt.scatter([x0, ], [y0, ], s=50, color='b') # method 1: ######...

2018-04-10 10:17:49 245

原创 矩阵求导

矩阵求导矩阵求导的两种规则向量对标量求导 和 标量对向量求导: 向量对向量求导,我们可以得到如下两条思路: 1. y里的元素分别对x求导(即参照标量对向量求导) 2. y分别对x里的元素求导(即参照向量对标量求导)规则1:当我们把标量对向量的求导结果认为是列向量时,向量对标量的求解结果就是一个行向量(从规则1不难发现,对于向量标量求导的两种情形,我们把标量对向量的求导结果作...

2018-03-29 12:05:34 276

原创 spacemacs notes

ORGM + /: file name/ address auto complete

2018-02-07 11:20:31 389

原创 uva 10129 - Play on Words

Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very imp

2018-01-23 20:31:49 161

原创 PAT 1004. To Buy or Not to Buy - Hard Version (35)

Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only sell

2017-10-21 23:20:31 315

原创 PAT 1003. Universal Travel Sites (35)

After finishing her tour around the Earth, CYLL is now planning a universal travel sites development project. After a careful investigation, she has a list of capacities of all the satellite transporta

2017-10-21 14:37:24 2593

空空如也

空空如也

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

TA关注的人

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