- 博客(465)
- 资源 (3)
- 问答 (2)
- 收藏
- 关注
原创 git 简单入门
note:: 此时master主分支和dev分支出现各自的变化,dev中的test.txt文件为dev,而master文件中的test.txt为空。git branch // 查找分支 此时有master 和 dev分支, 此时在dev分支。git checkout -b dev //创建并切换dev分支。vim test.txt // 写入master字符串。cat test.txt //显示master字符串。vim test.txt //写入dev。cat test.txt //出现dev。
2023-11-14 14:21:32 145
原创 C++ 虚析构与纯虚析构
多态使用时候,如果子类中在堆区开辟属性,父类的指针在释放时候无法调用子类的析构代码解决方式:将父类的析构函数调为虚析构函数虚析构与纯虚析构的区别:如果是纯虚析构,该类属于抽象类,无法实例化对象。
2023-05-03 18:35:40 92
原创 data augument(一)
def rand_cutout(): ratio = 0.5 x = imread('01.png') imshow('input:', x) h = x.shape[0] w = x.shape[1] x = np.transpose(x, (-1, 0, 1)) x = torch.from_numpy(x).unsqueeze(0) cutout_size = int(h * ratio + 0.5), int(w * ratio +.
2021-12-24 20:48:51 2090 1
原创 data agumentation
def rand_crop(): img = imread('01.png') imshow('input', img) h = img.shape[0] w = img.shape[1] print('h.shape:', h) print('w.shape:', w) img = np.transpose(img, (-1, 0, 1)) img = torch.from_numpy(img).unsqueeze(0) print.
2021-12-24 16:55:41 1911
原创 tensorflow model的用法
import tensorflow as tffrom tensorflow.keras import layers, modelsmodels = models.Sequential()models.add(layers.Conv2D(32, kernel_size=(3, 3), activation='relu', input_shape=(32, 32, 3)))models.add(layers.MaxPooling2D((2, 2)))models.add(layers.Conv.
2021-11-28 21:28:05 2885
原创 计算数据集的均值和方差
cifar10:def unpickle(file): import _pickle as cPickle with open(file, 'rb') as f: dict = cPickle.load(f, encoding='latin1') return dictdef get_mean_and_std(root_dir): train_data = [] train_label = [] for n in range(1, .
2021-11-17 10:24:59 2419
原创 tensorflow中tf.nn.maxpool()
tf.nn.max_pool(feature_map, k_size, strides, padding)h : 需要池化的输入,一般池化层接在卷积层后面,所以输入通常是feature map,依然是[batch_size, height, width, channels]这样的shapek_size : 池化窗口的大小,取一个四维向量,一般是[1, height, width, 1],因为我们不想在batch和channels上做池化,所以这两个维度设为了1strides : 窗口在每一个维度上.
2021-11-01 10:30:11 274
原创 tensorflow中tf.nn.conv2d()
tf.nn.conv2d (input, filter, strides, padding, use_cudnn_on_gpu=None, data_format=None, name=None)参数:input : 输入的要做卷积的图片,要求为一个张量,shape为 [ batch, in_height, in_width, in_channel ],其中batch为图片的数量,in_height 为图片高度,in_width 为图片宽度,in_channel 为图片的通道数,灰度图该值为1,彩色
2021-11-01 10:14:56 129
原创 tensorflow 1.14.0
创建迭代器可重新初始化迭代器可以通过多个不同的Dataset对象进行初始化.这些对象具有相同的结构(即每个组件具有相同类型和兼容形状)import tensorflow.compat.v1 as tftf.disable_v2_behavior()training_dataset = tf.data.Dataset.range(100).map( lambda x: x + tf.random_uniform([], -10, 10, tf.int64))validat...
2021-10-31 20:42:33 534
原创 tensorflow中tf.placeholder()
tf.placeholder()是用来分配变量在计算机中的内存,优化系统,不是为变量直接赋值等到session.run()后才会用feed_dict 字典对变量直接赋值。import tensorflow as tfimport numpy as npinput1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32)output = tf.multiply(input1, input2)with tf.Ses
2021-10-29 22:04:09 323
python的学习PPT
2020-09-02
福州大学863数据结构ppt.zip
2020-01-10
如何用孪生网络进行图像分类(不是二分类,多标签分类)
2020-09-09
TA创建的收藏夹 TA关注的收藏夹
TA关注的人