- 博客(8)
- 收藏
- 关注
原创 一招解决4道leetcode hard题,动态规划在字符串匹配问题中的应用
在做leetcode的时候,遇到hard题大家往往都觉得头疼,但其实,掌握方法,举一反三,hard题有时候我们也能想到好的思路,顺利攻破,今天我们就介绍一下动态规划在字符串匹配中的应用,相同类型的题目在前120道题中居然出现了4次!有必要好好总结一下! 这四道题分别是: 10. Regular Expression Matching:https://leetcode.com/problems/...
2019-09-21 19:55:09 258
原创 #1)设计一函数把小于一亿的int型数字转换成中文表示 #输入:54321 #输出:五万四千三百二十一
#include "pch.h" #include<iostream> #include<stack> #include<string> #include<algorithm> #include<vector> #include<map> using namespace std; class Solution { publ...
2019-08-14 10:20:15 411
转载 Keras可视化报错Failed to import pydot问题
1.keras模型可视化 keras.utils.vis_utils模块提供了画出Keras模型的函数(利用graphviz) 该函数将画出模型结构图,并保存成图片: from keras.utils import plot_model plot_model(model, to_file='model.png') plot_model接收两个可选参数: show_shapes:指定是否...
2019-07-14 20:08:04 150
转载 np.expand_dims函数
即扩展维度,np.expand_dims(a,axis=)即在相应的axis轴上扩展维度 a = np.array([[1,2],[3,5]]) b=(a==0).astype(np.float) y = np.expand_dims(a, axis=2) z = np.expand_dims(a, axis=1) print(a.shape) print(y.shape) print(z.s...
2019-06-20 09:30:44 3150
转载 cuda、cudnn与TensorFlow版本对应关系
Latest TensorFlow supports cuda 8-10. cudnn 6-7. Each TensorFlow binary has to work with the version of cuda and cudnn it was built with. If they don't match, you have to change either the TensorFlow...
2019-06-07 13:28:33 577
转载 enum与typedef enum的用法
在程序中,可能需要为某些整数定义一个别名,我们可以利用预处理指令#define来完成这项工作,您的代码可能是: #defineMON1 #defineTUE2 #defineWED3 #defineTHU4 #defineFRI5 #defineSAT6 #defineSUN7 在此,我们定义一种新的数据类型,希望它能完成同样的工作。...
2019-05-16 17:38:57 97
原创 python用ctypes调用c++.dll库
注意事项: (1)在编写的时候函数用下面方式声明: #define DLLEXPORT extern "C" __declspec(dllexport) extern "C" __declspec(dllexport) int open(); 其中open()为一个返回值为整形的函数。 (2)要把.dll依赖的其他.dll库也包含进来,如果依赖的包也依赖其他包,也要包含进来(容易出错),用...
2019-05-13 14:27:35 381
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人