CNN_SVM

2023-11-09

先用CNN提取特征,之后用SVM分类,平台是TensorFlow 1.6.0-rc0,python2.7

这个是我的一个小小的测试,下面这个链接是我主要参考的,在实现过程中,本来想使用vgg16或者VGG19做迁移来提取特征,但是担心自己的算力不够,还有就是UCI手写数据集本来就是一个不大的数据集,使用vgg16或vgg19有点杀鸡用牛刀的感觉。于是放弃做迁移。

我的代码主要是基于下面链接来的。参考链接点击打开链接

这个代码主要是,通过一个CNN网络,在网络的第一个全连接层也就h_fc1得到的一个一维的256的一个特征向量,将这个特征向量作为的svm的输入。主要的操作是在代码行的140-146.    同时代码也实现了CNN的过程(读一下代码就知道)。

如果你要是知道你的CNN的结构,然后就知道在全连接层输出的其实就是一个特征向量。直接用这个特征向量简单处理输入到svm中就可以。

具体的参考论文和代码数据集等,百度网盘

目标是对UCI的手写数字数据集进行识别,样本数量大约是1600个。图片大小为16x16。要求必须使用SVM作为二分类的分类器。
本文重点是如何使用卷积神经网络(CNN)来提取手写数字图片特征,主要想看如何提取特征的请直接看源代码部分的94行左右,只要对tensorflow有一点了解就可以看懂。在最后会有完整的源代码、处理后数据的分享链接。转载请保留原文链接,谢谢。


UCI手写数字的数据集

源数据下载:http://oddmqitza.bkt.clouddn.com/archivetempsemeion.data
其中前256维为16x16的图片,后10维为one hot编码的标签。即0010000000代表2,1000000000代表0.
组合成图片大约是这样的:
image233

卷积和池化形象理解

卷积
image1

池化
image2

仔细的看,慢慢想就能明白CNN提取特征的思想巧妙之处。
能明白这两点,剩下的东西就和普通的神经网络区别不大了。

为什么要用CNN提取特征?

1.由于卷积和池化计算的性质,使得图像中的平移部分对于最后的特征向量是没有影响的。从这一角度说,提取到的特征更不容易过拟合。而且由于平移不变性,所以平移字符进行变造是无意义的,省去了再对样本进行变造的过程。
2.CNN抽取出的特征要比简单的投影、方向,重心都要更科学。不会让特征提取成为最后提高准确率的瓶颈、天花板
3.可以利用不同的卷积、池化和最后输出的特征向量的大小控制整体模型的拟合能力。在过拟合时可以降低特征向量的维数,在欠拟合时可以提高卷积层的输出维数。相比于其他特征提取方法更加灵活

CNN卷积层简介

CNN,有两个卷积(5*5)池化层(2*2的maxPooling),然后两个全连接层h_fc1和h_fc2,我只使用第一个全连接层h_fc1就提取了特征。

然后中间的激活函数使用的是relu函数,同时为了防止过拟合使用了dropout的技巧。然后这个代码中其实是实现了完整的CNN的的预测的,损失使用交叉熵,优化器使用了AdamOptimizer。

图片大小的变化:

最后从全连接层提取的256维的向量。输入svm。

 

SVM分类

SVM采用的是RBF核(高斯核),C取0.9

也可以尝试线性核,我试了一下效果差不多,但是没有高斯核分类效率好。

流程和实验设计

 

流程:整理训练网络的数据,对样本进行处理 -> 建立卷积神经网络-> 将数据代入进行训练 -> 保存训练好的模型(从全连接层提取特征) -> 把数据代入模型获得特征向量 -> 用特征向量代替原本的输入送入SVM训练 -> 测试时同样将h_fc1转换为特征向量之后用SVM预测,获得结果。

使用留出法样本处理和评价:

1.将原样本随机地分为两半。一份为训练集,一份为测试集

2.重复1过程十次,得到十个训练集和十个对应的测试集

3.取十份训练集中的一份和其对应的测试集。代入到CNN和SVM中训练。

4.依次取训练集和测试集,则可完成十次第一步。

5.将十次的表现综合评价,十次验证取平均值,计算正确率、准确率、召回率、F1值。比如 F1 分数 , 用于测量不均衡数据的精度. 


 
 
  1. # coding=utf8
  2. import random
  3. import numpy as np
  4. import tensorflow as tf
  5. from sklearn import svm
  6. from sklearn import preprocessing
  7. right0 = 0.0 # 记录预测为1且实际为1的结果数
  8. error0 = 0 # 记录预测为1但实际为0的结果数
  9. right1 = 0.0 # 记录预测为0且实际为0的结果数
  10. error1 = 0 # 记录预测为0但实际为1的结果数
  11. for file_num in range( 10):
  12. # 在十个随机生成的不相干数据集上进行测试,将结果综合
  13. print( 'testing NO.%d dataset.......' % file_num)
  14. ff = open( 'digit_train_' + file_num.__str__() + '.data')
  15. rr = ff.readlines()
  16. x_test2 = []
  17. y_test2 = []
  18. for i in range(len(rr)):
  19. x_test2.append(list(map(int, map(float, rr[i].split( ' ')[: 256]))))
  20. y_test2.append(list(map(int, rr[i].split( ' ')[ 256: 266])))
  21. ff.close()
  22. # 以上是读出训练数据
  23. ff2 = open( 'digit_test_' + file_num.__str__() + '.data')
  24. rr2 = ff2.readlines()
  25. x_test3 = []
  26. y_test3 = []
  27. for i in range(len(rr2)):
  28. x_test3.append(list(map(int, map(float, rr2[i].split( ' ')[: 256]))))
  29. y_test3.append(list(map(int, rr2[i].split( ' ')[ 256: 266])))
  30. ff2.close()
  31. # 以上是读出测试数据
  32. sess = tf.InteractiveSession()
  33. # 建立一个tensorflow的会话
  34. # 初始化权值向量
  35. def weight_variable(shape):
  36. initial = tf.truncated_normal(shape, stddev= 0.1)
  37. return tf.Variable(initial)
  38. # 初始化偏置向量
  39. def bias_variable(shape):
  40. initial = tf.constant( 0.1, shape=shape)
  41. return tf.Variable(initial)
  42. # 二维卷积运算,步长为1,输出大小不变
  43. def conv2d(x, W):
  44. return tf.nn.conv2d(x, W, strides=[ 1, 1, 1, 1], padding= 'SAME')
  45. # 池化运算,将卷积特征缩小为1/2
  46. def max_pool_2x2(x):
  47. return tf.nn.max_pool(x, ksize=[ 1, 2, 2, 1], strides=[ 1, 2, 2, 1], padding= 'SAME')
  48. # 给x,y留出占位符,以便未来填充数据
  49. x = tf.placeholder( "float", [ None, 256])
  50. y_ = tf.placeholder( "float", [ None, 10])
  51. # 设置输入层的W和b
  52. W = tf.Variable(tf.zeros([ 256, 10]))
  53. b = tf.Variable(tf.zeros([ 10]))
  54. # 计算输出,采用的函数是softmax(输入的时候是one hot编码)
  55. y = tf.nn.softmax(tf.matmul(x, W) + b)
  56. # 第一个卷积层,5x5的卷积核,输出向量是32维
  57. w_conv1 = weight_variable([ 5, 5, 1, 32])
  58. b_conv1 = bias_variable([ 32])
  59. x_image = tf.reshape(x, [ -1, 16, 16, 1])
  60. # 图片大小是16*16,,-1代表其他维数自适应
  61. h_conv1 = tf.nn.relu(conv2d(x_image, w_conv1) + b_conv1)
  62. h_pool1 = max_pool_2x2(h_conv1)
  63. # 采用的最大池化,因为都是1和0,平均池化没有什么意义
  64. # 第二层卷积层,输入向量是32维,输出64维,还是5x5的卷积核
  65. w_conv2 = weight_variable([ 5, 5, 32, 64])
  66. b_conv2 = bias_variable([ 64])
  67. h_conv2 = tf.nn.relu(conv2d(h_pool1, w_conv2) + b_conv2)
  68. h_pool2 = max_pool_2x2(h_conv2)
  69. # 全连接层的w和b
  70. w_fc1 = weight_variable([ 4 * 4 * 64, 256])
  71. b_fc1 = bias_variable([ 256])
  72. # 此时输出的维数是256维
  73. h_pool2_flat = tf.reshape(h_pool2, [ -1, 4 * 4 * 64])
  74. h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, w_fc1) + b_fc1)
  75. # h_fc1是提取出的256维特征,很关键。后面就是用这个输入到SVM中
  76. # 设置dropout,否则很容易过拟合
  77. keep_prob = tf.placeholder( "float")
  78. h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
  79. # 输出层,在本实验中只利用它的输出反向训练CNN,至于其具体数值我不关心
  80. w_fc2 = weight_variable([ 256, 10])
  81. b_fc2 = bias_variable([ 10])
  82. y_conv = tf.nn.softmax(tf.matmul(h_fc1_drop, w_fc2) + b_fc2)
  83. cross_entropy = -tf.reduce_sum(y_ * tf.log(y_conv))
  84. # 设置误差代价以交叉熵的形式
  85. train_step = tf.train.AdamOptimizer( 1e-4).minimize(cross_entropy)
  86. # 用adma的优化算法优化目标函数
  87. correct_prediction = tf.equal(tf.argmax(y_conv, 1), tf.argmax(y_, 1))
  88. accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))
  89. sess.run(tf.global_variables_initializer())
  90. for i in range( 3000):
  91. # 跑3000轮迭代,每次随机从训练样本中抽出50个进行训练
  92. batch = ([], [])
  93. p = random.sample(range( 795), 50)
  94. for k in p:
  95. batch[ 0].append(x_test2[k])
  96. batch[ 1].append(y_test2[k])
  97. if i % 100 == 0:
  98. train_accuracy = accuracy.eval(feed_dict={x: batch[ 0], y_: batch[ 1], keep_prob: 1.0})
  99. # print "step %d, train accuracy %g" % (i, train_accuracy)
  100. train_step.run(feed_dict={x: batch[ 0], y_: batch[ 1], keep_prob: 0.6})
  101. # 设置dropout的参数为0.6,测试得到,大点收敛的慢,小点立刻出现过拟合
  102. print( "test accuracy %g" % accuracy.eval(feed_dict={x: x_test3, y_: y_test3, keep_prob: 1.0}))
  103. # def my_test(input_x):
  104. # y = tf.nn.softmax(tf.matmul(sess.run(x), W) + b)
  105. for h in range(len(y_test2)):
  106. if np.argmax(y_test2[h]) == 7:
  107. y_test2[h] = 1
  108. else:
  109. y_test2[h] = 0
  110. for h in range(len(y_test3)):
  111. if np.argmax(y_test3[h]) == 7:
  112. y_test3[h] = 1
  113. else:
  114. y_test3[h] = 0
  115. # 以上两步都是为了将源数据的one hot编码改为1和0,我的学号尾数为7
  116. x_temp = []
  117. for g in x_test2:
  118. x_temp.append(sess.run(h_fc1, feed_dict={x: np.array(g).reshape(( 1, 256))})[ 0])
  119. # 将原来的x带入训练好的CNN中计算出来全连接层的特征向量,将结果作为SVM中的特征向量
  120. x_temp2 = []
  121. for g in x_test3:
  122. x_temp2.append(sess.run(h_fc1, feed_dict={x: np.array(g).reshape(( 1, 256))})[ 0])
  123. clf = svm.SVC(C= 0.9, kernel= 'linear') # linear kernel
  124. # clf = svm.SVC(C=0.9, kernel='rbf') #RBF kernel
  125. # SVM选择了RBF核,C选择了0.9
  126. # x_temp = preprocessing.scale(x_temp) #normalization
  127. clf.fit(x_temp, y_test2)
  128. # SVM选择了RBF核,C选择了0.9
  129. print( 'svm testing accuracy:')
  130. print(clf.score(x_temp2, y_test3))
  131. for j in range(len(x_temp2)):
  132. # 验证时出现四种情况分别对应四个变量存储
  133. # 这里报错了,需要对其进行reshape(1,-1)
  134. if clf.predict(x_temp2[j].reshape( 1, -1))[ 0] == y_test3[j] == 1:
  135. right0 += 1
  136. elif clf.predict(x_temp2[j].reshape( 1, -1))[ 0] == y_test3[j] == 0:
  137. right1 += 1
  138. elif clf.predict(x_temp2[j].reshape( 1, -1))[ 0] == 1 and y_test3[j] == 0:
  139. error0 += 1
  140. else:
  141. error1 += 1
  142. accuracy = right0 / (right0 + error0) # 准确率
  143. recall = right0 / (right0 + error1) # 召回率
  144. print( 'svm right ratio ', (right0 + right1) / (right0 + right1 + error0 + error1))
  145. print ( 'accuracy ', accuracy)
  146. print ( 'recall ', recall)
  147. print ( 'F1 score ', 2 * accuracy * recall / (accuracy + recall)) # 计算F1值

testing NO.0 dataset.......
2019-02-26 10:56:38.034846: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-02-26 10:56:38.035075: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1212] Found device 0 with properties:
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.62
pciBusID: 0000:01:00.0
totalMemory: 3.95GiB freeMemory: 3.51GiB
2019-02-26 10:56:38.035086: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2019-02-26 10:56:38.200398: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3244 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
test accuracy 0.964868
svm testing accuracy:
0.989962358846
testing NO.1 dataset.......
2019-02-26 10:56:51.302524: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2019-02-26 10:56:51.302645: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2702 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
test accuracy 0.951066
svm testing accuracy:
0.987452948557
testing NO.2 dataset.......
2019-02-26 10:57:03.968067: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2019-02-26 10:57:03.968175: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2702 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
test accuracy 0.958595
svm testing accuracy:
0.993726474279
testing NO.3 dataset.......
2019-02-26 10:57:16.675414: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2019-02-26 10:57:16.675521: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2702 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
test accuracy 0.961104
svm testing accuracy:
0.989962358846
testing NO.4 dataset.......
2019-02-26 10:57:29.536615: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2019-02-26 10:57:29.536743: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2702 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
test accuracy 0.961104
svm testing accuracy:
0.987452948557
testing NO.5 dataset.......
2019-02-26 10:57:42.186688: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2019-02-26 10:57:42.186795: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2702 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
test accuracy 0.953576
svm testing accuracy:
0.987452948557
testing NO.6 dataset.......
2019-02-26 10:57:55.075373: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2019-02-26 10:57:55.075485: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2702 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
test accuracy 0.956085
svm testing accuracy:
0.988707653701
testing NO.7 dataset.......
2019-02-26 10:58:08.269529: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2019-02-26 10:58:08.269642: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2702 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
test accuracy 0.971142
svm testing accuracy:
0.993726474279
testing NO.8 dataset.......
2019-02-26 10:58:21.115406: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2019-02-26 10:58:21.115523: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2702 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
test accuracy 0.941029
svm testing accuracy:
0.981179422836
testing NO.9 dataset.......
2019-02-26 10:58:34.057336: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2019-02-26 10:58:34.057453: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2702 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
test accuracy 0.95734
svm testing accuracy:
0.994981179423
('svm right ratio ', 0.9894604767879548)
('accuracy ', 0.9753424657534246)
('recall ', 0.9151670951156813)
('F1 score ', 0.9442970822281167)

使用CNN之后用SVM分类。这个操作有很多。比如RCNN(Regions with CNN features)用于目标检测的网络的一系列的算法【SPP-Net】。基本就是CNN之后svm。

 

参考文献

[1] Deep Learning using Linear Support Vector Machines, ICML 2013

[2] How transferable are features in deep neural networks?, Jason Yosinski,1 Jeff Clune,2 Yoshua Bengio, NIPS 2014

[3] CNN Features off-the-shelf: an Astounding Baseline for Recognition, Ali Sharif Razavian Hossein Azizpour Josephine Sullivan Stefan Carlsson CVAP, KTH (Royal Institute of Technology). CVPR 2014

主要参考第一篇,具体的论文我把论文放到百度网盘中了:

https://pan.baidu.com/s/1Ghh4nfjfBKDyA47fc6M4JQ

有相同的CNN之后使用SVM的一些GitHub的开源代码:

https://github.com/Fdevmsy/Image_Classification_with_5_methods

https://github.com/efidalgo/AutoBlur_CNN_Features

https://github.com/tomrunia/TF_FeatureExtraction

 原文:

https://blog.csdn.net/qq_27756361/article/details/80479278

 

----------------更多绿色版本软件及机器视觉学习资料----------------------- 请关注关注公众号:机器视觉智能解决方案
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

CNN_SVM 的相关文章

  • 【自定义表单】自定义表单设计

    1 后端设计1 diy field pool 字段池 我们定义好的字段类型 diy form 表单表 记录用户自定义的表单 diy form field 表单字段表 记录某张表单中有哪些字段 diy form entity 表单实例表 记录
  • XP下VMware模拟Ubuntu不能使用共享文件夹问题解决vmhgfs

    目前XP下使用VMware workstation 6 0 2虚拟ubuntu后 即使安装了VMware Tools并设置了共享文件夹后 虽然可以看到 mnt hgfs 但仍旧不能访问共享目录的解决方案 问题 主要问题是在安装vmware
  • 向较长的字符串中的指定位置添加指定元素

    今天抓取数据的时候获取到多个url中的翻页数据 但是单个url又需要进行翻页的操作 因此就需要在url中指定的位置添加新的参数用于数据的翻页 如何在指定位置添加指定的参数呢 下面通过一个例子来说明 url https list tmall
  • Qt线程之间通过signal和slot传递数据

    Qt线程之间通过signal和slot传递数据 这种方法主要是为了设置自己定义的数据类型 在不同的线程之间进行通信 如果自己定义的数据类型未经处理之间传递会报如下错误 QObject connect Cannot queue argumen
  • OpenSea进阶之路:成立4年估值超百亿美元

    来源 Odaily星球日报 作者 Jeff Kauflin 2022 新年伊始 加密行业迎来的第一个好消息就是 Opensea 这个 NFT市场的王者在 1 月 5 日宣布完成了一笔高达 3 亿美元的 C 轮融资 估值更是飙升到 130 亿

随机推荐

  • python网页爬虫xpath应用

    一 认识xpath和xml数据 lxml是Python基于xpath做数据解析的工具 from lxml import etree 1 xpath数据解析 通过提供标签路径来获取标签 xpath指的就是标签的路径 1 xpath基本感念 树
  • gin 四.响应数据

    响应数据 一 响应数据 二 c Writer Header Set处理响应头 一 响应数据 在gin中请求接口响应时 实际可以响应会html text plain json和xml等 比如前面gin基础示例中 接口响应时可以使用 gin C
  • 关键字 package、import的使用

    一 package 关键字的使用 为了更好的实现项目中类型的管理 提供了包的概念 使用package声明类或接口所属的包 声明在源文件的首行 包 术语标识符 遵循标识符的命名规则 规范 xxxyyyzzz 见名知意 每 一次 就代表一层文件
  • 安卓页面去掉顶部标题

    我的个人博客 逐步前行STEP 将AndroidManifest xml文件中的
  • 【Visual Studio 2015】安全开发生命周期(SDL)检查

    有的时候写的代码明明没有什么问题就是编译不过 我就觉得奇怪了 我是编译通过的代码 怎么就有问题呢 在VS2015运行 还真是有问题 看错误提示 是VS将这个函数的使用当做错误对待了 在以前的VS版本中 检测并不严格 对于很多警告 我们程序员
  • 微信小程序 view内英文数字不换行

    view标签英文不换行 最近遇到一个bug 在一个text标签内 如果纯粹的中文字符那是可以换行的 如果text标签内出现了英文或者数字的组合 这个标签换行bug了 溢出了 OMG 我的天啊 赶紧去翻翻html5中遇到这样的问题怎么解决 果
  • cobaltstrike流量特征

    cobaltstrike流量特征 cobaltstrike是红队攻防中常用的工具 用以连接目标和cobaltstrike服务器 方便红队进一步对目标渗透 在双方通信过程中cobaltstrike流量具有很明显的特征 1 http 请求 ht
  • winre drv分区干嘛用的_用U盘PE做传统启动方式的系统!

    U盘做系统教程 1 需要一个空闲U盘一个容量最少8G的 然后需要下载一个系统的镜像 可以去网上查找 2 下载U盘PE系统 链接 http download itiankong net data 3 easyu EasyU 3 5 2019
  • weblogic日志路径

    weblogic日志路径 C bea user projects domains base domain servers AdminServer logs 访问日志请求 access log 管理日志 AdminServer log 域日志
  • dataframe在最后新增一行_padans给Dataframe插入新增列、行

    import pandas as pd df1 pd DataFrame Snow M 22 Tyrion M 32 Sansa F 18 Arya F 14 columns name gender age 新增一列相同的数据 df1 ad
  • 小程序AP配网和AK配网教程(开源)

    小程序AP配网和AK配网教程 开源 一 Airkiss配网的实现方式 Airkiss配网我们采用插件的形式 非常简单方便 感谢半颗心脏大佬的开源插件 1 Airkiss 简介 AirKiss是微信硬件平台为Wi Fi设备提供的微信配网 局域
  • 程序员的浪漫——用Python画一颗会发光的圣诞树

    圣诞节到了 给你最爱的人送上一棵python做的圣诞树吧 程序员的专属浪漫 我的朋友圈已经让圣诞树刷屏了 今天来给大家分享一波如何使用 Python 来画一颗圣诞节树 包含多种 版本 从平民版到豪华版 部分代码哦 import turtle
  • activiti MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row

    项目中集成activiti 在win7下面测试的很好 但是部署到linux环境下面就出现问题了 重要的部分 ERROR 2013 11 20 13 37 35 CommandContext close Error while closing
  • Java gdal .mif/.mid文件读取

    上一篇研究了 Windows10 64位 Python读取 mif mid文件并转成txt 今天研究一下Java读取MIF 俩种解决办法 1 Python程序读取 mif mid转成txt Java程序读取txt文件进行处理 需要Pytho
  • SQL server中merge语句添加where条件

    SQL server中merge语句添加where条件 1 merge语句添加where条件 在SQL Server中 可以使用MERGE语句将INSERT UPDATE和DELETE操作组合在一起 根据指定的条件将数据合并到目标表中 如果
  • 使用jupyter中的matplotlib库绘制简单图表2

    1 使用stackplot 绘制堆积面积图 1 plt title 2020080603012 import numpy as np import matplotlib pyplot as plt x np arange 6 y1 np a
  • 机器学习基本模型与算法在线实验闯关

    第1关 缺失值填充 任务描述 本关任务 读取 银行贷款审批数据 xlsx 表 自变量为x1 x15 决策变量为y 1 同意贷款 0 不同意贷款 其中x1 x6为数值变量 x7 x15为名义变量 请对x1 x6中存在的缺失值用均值策略填充 x
  • arc用matlab表示,arctan在matlab中怎么表示

    例如 已知tan x 3 3 求2113x 程序如下5261 x atan sqrt 3 3 4102运行1653结果 x 0 5236 得到的是弧度 一般我们习惯用角度来内表示 容如下转化 x x 180 pi 运行结果 x 30 000
  • 设计一个O(n2)时间的算法, 找出由n个数组成的序列的最长单调递增子序列。

    设计一个O n2 时间的算法 找出由n个数组成的序列的最长单调递增子序列 代码如下 define CRT SECURE NO WARNINGS 1 include
  • CNN_SVM

    先用CNN提取特征 之后用SVM分类 平台是TensorFlow 1 6 0 rc0 python2 7 这个是我的一个小小的测试 下面这个链接是我主要参考的 在实现过程中 本来想使用vgg16或者VGG19做迁移来提取特征 但是担心自己的