自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Java线程池

为什么使用线程池?启动一个新线程非常方便,但是,创建线程需要操作系统资源(线程资源,栈空间等),频繁创建和销毁大量线程需要消耗大量时间。那么我们就可以把很多小任务让一组线程来执行,而不是一个任务对应一个新线程。这种能接收大量小任务并进行分发处理的就是线程池。简单地说,线程池内部维护了若干个线程,没有任务的时候,这些线程都处于等待状态。如果有新任务,就分配一个空闲线程执行。如果所有线程都处于忙碌状态,新任务要么放入队列等待,要么增加一个新线程进行处理。

2021-04-16 14:32:51 69

原创 冒泡排序

class BubbleSort1 { public static int[] bubbleSort(int[] arr) { if (arr.length <= 1) { return arr; } for (int i = 0; i < arr.length - 1; i++) { for (int j = 0; j < arr.length - 1 - i; j++) { .

2021-04-16 11:37:21 66

原创 莫烦Pytorch之保存加载网络

import torchfrom torch.autograd import Variableimport matplotlib.pyplot as pltx=torch.unsqueeze(torch.linspace(-1,1,1000),dim=1)y=x.pow(2)+0.2*torch.rand(x.size())def save(): net1=torch.nn....

2018-11-05 17:22:26 198

原创 莫烦Pytorch之快速构建网络代码

import torchimport torch.nn.functional as Fclass Net(torch.nn.Module): def __init__(self,n_feature,n_hidden,n_output): super(Net,self).__init__() self.hidden=torch.nn.Linear(n_f...

2018-11-04 18:43:27 118

原创 莫烦Pytorch系列之分类代码

import torch#from torch.autograd import Variableimport torch.nn.functional as Fimport matplotlib.pyplot as pltn_data=torch.ones(100,2) # 数据的基本形态x0=torch.normal(2*n_data,1) # 类型0 x data (te...

2018-11-04 18:35:55 637

转载 regression(2)

import torchimport torch.nn.functional as F # 激励函数都在这import matplotlib.pyplot as pltfrom torch.autograd import Variablex = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1) # x data (tenso...

2018-11-02 18:27:36 201

原创 Pytorch入门之线性回归

import numpy as npimport matplotlib.pyplot as pltimport torchimport torch.nn as nnfrom torch.autograd import Variablex_train=np.array([[3.3],[4.4],[5.5],[6.71],[6.93],[4.168], ...

2018-11-01 17:47:51 146

原创 欢迎使用CSDN-markdown编辑器

欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl

2017-07-25 18:03:04 146

空空如也

空空如也

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

TA关注的人

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