- 博客(40)
- 资源 (5)
- 收藏
- 关注
原创 TFhub、Keras预训练模型进行推理简单示例
导入预训练模型进行推理。以mobilenetv2 Imagenet预训练模型为例:import tensorflow as tfimport tensorflow_hub as hubimport numpy as np# 加载图片image = tf.image.decode_image(tf.io.read_file('/path/to/your/image'),channels=3)image = tf.image.resize(image,(224,224))image = tf
2020-11-30 10:36:34
1278
1
原创 TF hub模型保存成savedmodel格式
以mobilenet v2为例import tensorflow as tfimport tensorflow_hub as hubIMAGE_SHAPE = (224, 224)m = tf.keras.Sequential([ hub.KerasLayer("https://hub.tensorflow.google.cn/google/tf2-preview/mobilenet_v2/classification/4", input_shape=IMAGE_SHAPE+(3,),
2020-11-24 23:29:09
426
原创 Tensorflow saved_model.pb 文件转成 saved_model.pbtxt文件
想把saved_model.pb里的metagraph转成可读。代码如下:#将.pb文件load到session中,导出到.pbtxt可视化import tensorflow as tffrom tensorflow.python.platform import gfiletf.compat.v1.disable_eager_execution()model = './savedmodel/VGG16/1/'export_dir = './test/'with tf.compat.v1.
2020-11-24 23:23:24
2829
2
原创 Miniconda简单命令
设置虚拟环境conda create -n ENVNAME python=3.6conda删除虚拟环境conda remove --name ENVNAME --all激活base环境conda activate base激活虚拟环境conda activate ENVNAME 退出环境conda deactivate环境里安装包conda install -n myenv scipy=0.15.0查看所有环境conda env list
2020-09-13 17:40:38
4224
1
原创 Spring boot 发送邮件简易使用
使用Spring Boot提供 Spring boot starter mail。Maven Dependency<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId></dependency>puclic class MailService {
2020-08-16 17:20:01
126
原创 HttpClient简易使用
工作中用到HttpClient发送一个请求到https服务器。携带auth-token和csv文件。现在此做一个小结。版本4.x.xhttpcore:对HTTP协议的基础封装的一套组件。 httpclient:基于httpcore的一个HTTP客户端实现。 httpmime:包括了所有的MIME类型,便于解析。MAVEN依赖<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
2020-08-16 16:49:00
301
原创 SpringBoot Data Redis 使用
工作中碰到。现记录一下。keywords:JDK1.8,SpringBoot 2.2.5, Lettuce, Sentinelapplication.ymlspring: application: dev-8090.com redis: database: 3 lettuce: pool: max-active: 100 max-wait: 15000 max-idle: 100 min-idl
2020-07-31 20:03:18
428
原创 MySQL Explain
MySQL Explain查看执行计划包含的信息EXPLAIN + SQL语句使用EXPLAIN关键字可以模拟优化器执行SQL查询语句,从而知道MySQL是如何处理SQL语句的。分析查询语句或者是表结构的性能瓶颈。表的读取顺序 数据读取操作的操作类型 哪些索引可以使用 哪些索引被实际使用 表之间的引用 每张表有多少行被优化器查询表头id select_type table type possible_keys key key_len
2020-05-23 23:06:36
165
原创 排序笔记
Sort Algorithms Name Time Complexity Space Complexity Stable Type Average Worst Best 1 Bubble Sort O(n) O(1) Yes CBA 2 Insertion Sort ...
2019-11-05 07:43:21
146
原创 Angular Notes
Angular Notesangular is a JavaScript Framework which allows you to create reactive Single-Page-Applications(SPAs).Plan the AppAngular CLInpm install -g @angular/cli// then go to the folder...
2019-10-09 06:17:01
738
原创 Typescript Brief
TypescriptTypestrong typing allows us to define types for our variables and class membersThe compiler is going to yell at us if we assign a value of a wrong type to such a variable or member//...
2019-09-25 06:18:42
120
原创 GraphQL APIs Notes
GraphQL APIshave a rich query language that you use in your front end to send through requests to the backend which is then parsed on the back end and dynamically retrieves just the data ...
2019-09-16 15:21:12
157
原创 REST APIs notes
REST APIstransfer data (in json) instead of the html page. Let the client-side to render the page based on the data received.Representational State Transfer每一个URI代表一种资源 客户端和服务器之间,传递这种资源的某种表...
2019-09-16 03:58:54
153
原创 Databases - NoSQL
NoSQLMongoDBnpm install --save mongodbDatabase connectionconst mongodb = require("mongodb");const MongoClient = mongodb.MongoClient;let _db;const mongoConnect = (callback =>{...
2019-09-12 12:51:29
527
原创 Databases - SQL
SQL vs NoSQLConnect app to SQL databasenpm install --save mysql2Connection setupconst mysql = require('mysql2');// connection pool// manage multiple connections (multip...
2019-09-11 11:39:18
312
原创 EJS
Templates and EJStemplate engine// App set allows us to set any values globally on our express applicationapp.set("view engine","ejs");Add logic to HTMLEmbedded JavaScript templating, ...
2019-09-09 14:19:06
374
原创 NodeJS Notes
NodeJSA web server is a computer hosting one or more websites. "Hosting" means that all the web pages and their supporting files are available on that computer. The web server will send any web pag...
2019-09-08 14:02:58
453
原创 C++ Concurrency Notes
C++ Concurrency1.Thread managementprocessA process is an instance of a computer program that is being executed. thread is component of a process. every process have at least one thread called m...
2019-09-04 14:28:28
515
原创 Web Developer Bootcamp - DOM
Web Developer Bootcamp - Document Object Modelinterface between your Javascript and HTML+CSS The browser turns every HTML tag into a Javascript object that we can manipulate Everything is stored i...
2019-08-08 15:18:23
209
原创 JavaScript Notes
JavaScript NotesPrimitive Datatypesin stackstring, number, boolean, null, undefined, Symbol(ES6)//string"hello world"//number49.3-10//booleantruefalse// null and undefinednullun...
2019-08-07 19:24:04
356
原创 Web developer bootcamp - CSS
Web developer bootcamp - Cascading Style SheetsThe general ruleselector { property: value; anotherProperty: value;}example:/*Make All h1's purple and 56px font*/h1 { color: pu...
2019-08-06 16:56:21
231
原创 Web developer bootcamp - HTML
Web developer bootcamp - HTMLgeneral rule:<tagName> Some Content </tagName>Every HTML document we create will start with this boilerplate:<!DOCTYPE html> <html> <...
2019-08-05 18:12:40
353
原创 背包问题笔记
背包 Knapsack0-1背包问题有 N 种物品,一个容量为 V 的背包,第 i 件物品的体积为 cap[i],价值为 val[i],求在不超过背包容量限制的情况下所能获得的最大物品价值和为多少?因为在这个问题中,一件物品要么不选,要么选,正好对应于 0-1 两个状态,所以我们一般把形如这样的背包问题称作 0-1 背包问题。状态:定义状态:knapsack[i][j]代表...
2019-06-20 12:15:21
148
原创 线段树和树状数组笔记
线段树和树状数组一、线段树线段树是什么首先线段树是一棵平衡二叉树,平常我们所指的线段树都是指一维线段树。故名思义, 线段树能解决的是线段上的问题, 这个线段也可指区间。线段树支持三个操作:build(start,end,vals) -> O(n)update(index,value) -> O(logn)query(start,end) -> O(log...
2018-12-29 10:34:26
411
原创 算法强化班小结
Chapter 1 Cracking the Follow Up Interview Questions同向双指针模板O(n)j = 0for i in range(n): //挪动 i 的时候,看看 j 最多挪动到哪儿。 //j 代表的是 subarray 右断点的 index + 1 的位置。因此 j - i 是 Subarray 的长度 while j &...
2018-11-17 17:54:26
529
原创 算法班小结
Chapter 2: Binary Search & LogN Algorithm时间复杂度分析O(1) O(logn) 二分法 O(sqrt n) 分解质因数 O(n) 高频 O(nlogn) 排序 O(n^2) 数组,枚举,动规 O(n^3) 数组,枚举,动规 O(2^n) 组合有关搜索 O(...
2018-10-21 15:17:12
773
转载 算法班笔记 第九章 数据结构:区间、数组、矩阵和树状数组
第九章 数据结构:区间、数组、矩阵和树状数组子数组与前缀和SubarryPrefixSum[i] = A[0] + A[1] + ... + A[i-1]PrefixSum[0] = 0;构造花费 O(n) 时间,O(n) 空间Sum(i to j) = prefixsum[j+1] - prefixsum[i];Maximum subarray Subarray ...
2018-10-20 14:20:28
347
转载 算法班笔记 第八章 数据结构:栈,队列,哈希表,堆
第八章 数据结构:栈,队列,哈希表,堆栈 Stack我们在前面的二叉树的学习中,已经学习了如何使用 Stack 来进行非递归的二叉树遍历。这里我们来看看栈在面试中的其他一些考点和考题:如果自己实现一个栈? 如何用两个队列实现一个栈? 用一个数组如何实现三个栈?如何实现一个栈?什么是栈(Stack)?栈(stack)是一种采用后进先出(LIFO,last in fi...
2018-10-18 14:52:47
479
转载 算法班笔记 第七章 基于排列、图的DFS
第七章 基于排列、图的DFS全排列问题如何使用深度优先搜索来实现?和全子集问题的异同在哪儿? 全排列问题的 Follow up: Permutation II。如何去重? 如何求一个排列的下一个排列? 如何求一个排列是第几个排列?如何求下一个排列问题描述给定一个若干整数的排列,给出按整数大小进行字典序从小到大排序后的下一个排列。若没有下一个排列,则输出字典序最小的序列。例如1...
2018-09-26 06:05:36
284
转载 算法班笔记 第六章 基于组合的DFS
第六章 基于组合的DFS在非二叉树上的深度优先搜索(Depth-first Search)中,90%的问题,不是求组合(Combination)就是求排列(Permutation)。特别是组合类的深度优先搜索的问题特别的多。通过全子集问题 Subsets 了解组合类搜索的两种形式 通过全子集问题 II 了解如何在搜索中去重 使用非递归的方法实现全子集问题全子集问题 题目的意思就是...
2018-09-25 15:16:13
486
转载 算法班笔记 第五章 二叉树和基于树的DFS
第五章 二叉树和基于树的DFS在这一章节的学习中,我们将要学习一个数据结构——二叉树(Binary Tree),和基于二叉树上的搜索算法。在二叉树的搜索中,我们主要使用了分治法(Divide Conquer)来解决大部分的问题。之所以大部分二叉树的问题可以使用分治法,是因为二叉树这种数据结构,是一个天然就帮你做好了分治法中“分”这个步骤的结构。二叉树上的遍历法定义遍历(Trav...
2018-09-23 15:07:43
820
转载 算法班笔记 第四章 BFS 与拓扑排序
第四章 BFS与拓扑排序什么是队列(Queue)队列(queue)是一种采用先进先出(FIFO,first in first out)策略的抽象数据结构。比如生活中排队,总是按照先来的先服务,后来的后服务。队列在数据结构中举足轻重,其在算法中应用广泛,最常用的就是在宽度优先搜索(BFS)中,记录待扩展的节点。队列内部存储元素的方式,一般有两种,数组(array)和链表(linked l...
2018-09-23 09:49:27
825
转载 算法班笔记 第二章 二分与 LogN 算法
第二章 二分与 LogN 算法算法复杂度理论时间复杂度是面试中必问的问题。学好时间复杂度,有如下的帮助:面试官会问你的算法时间复杂度是什么 当面试官说,有没有更好的方法时,你知道朝什么样的复杂度优化 利用时间复杂度倒推算法是面试常用技巧。如 O(logN)的算法几乎可以确定是二分法。一个算法的运行时间与其所要执行的语句的数量成正比,而所要执行的语句与问题规模正相关。因此算法的时间...
2018-09-23 07:12:17
1315
转载 算法班笔记 第三章 双指针算法
第三章 双指针算法相向双指针 相向双指针,指的是在算法的一开始,两根指针分别位于数组/字符串的两端,并相向行走。如我们在小学的时候经常遇到的问题:小明和小红分别在铁轨A站和B站相向而行,小红的速度为 1m/s, 小明的速度为 2m/s,A站和B站相距 1km。请问 ... 他们什么时候被火车撞死?一个典型的相向双指针问题就是翻转字符串的问题。在第二节课中我们学到的三步翻转法,...
2018-09-23 07:11:47
1753
Probabilistic Graphical Models- Principles and Techniques -Daphne Koller
2019-02-21
Machine Learning A Probabilistic Perspective-Kevin P.Murphy
2019-02-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人