- 博客(79)
- 资源 (4)
- 收藏
- 关注
原创 ubuntu server 开机自动登录并启动jupyter lab
如果你的 Ubuntu Server 系统没有安装桌面环境,就没有 lightdm 管理器可用了,开机自动登录需要用到 tty。用户的 bashrc 配置文件中,使得每次打开终端,都会自动启动。接下来创建启动命令的脚本,使用以下命令创建一个名为。命令是为了等待系统启动完成,防止启动脚本失败。用户会自动登录到 tty1 终端,并启动。只有当不是在桌面环境下,而且当前终端是。中,这样就不会在终端中产生输出。用户登录到 tty1 终端时,接下来,需要将脚本添加到。重启系统,等待系统启动,
2023-06-06 11:53:01 1549
原创 解决TensorFlow出现的Could not load dynamic library ‘libcurand.so.10‘等类似的问题
其中第一个是我想要的,因为这个是我环境中的,但是要注意,我们指定到达。说明已经可以识别GPU咯。
2023-05-29 22:44:46 1028
原创 pytorch随机数种子设置
if args.seed is not None: torch.manual_seed(args.random_seed) torch.cuda.manual_seed(args.random_seed) torch.cuda.manual_seed_all(args.random_seed) np.random.seed(args.random_seed) random.seed(args.random_seed) tor
2021-12-01 20:16:52 1229
原创 latex自定义图片命名前缀以及设定表格名称范围与大小
自定义前缀\NeedsTeXFormat{LaTeX2e}[2007/10/19]\ProvidesClass{cpbtex}[2014/11/12 v1.0 LaTeX Template for Chinese Physics B]\LoadClass[a4paper]{article}[2007/10/19]\RequirePackage{amsmath,amsfonts,amssymb,bm,CJK,ccmap}\RequirePackage{graphics,epstopdf,ifpd
2021-11-20 17:50:59 2699
原创 论文绘图与合成图片过程中常见问题
1、PIL格式与cv2格式的转换问题详见Stack overflowTo convert from PIL image to OpenCV use:import cv2import numpy as npfrom PIL import Imagepil_image=Image.open("demo2.jpg") # open image using PIL# use numpy to convert the pil_image into a numpy arraynumpy_image=
2021-11-04 21:46:49 2011
原创 matplotlib相关注意事项
1、正常显示中文与正负号plt.rcParams['font.sans-serif']=['SimHei'] # 正常显示中文plt.rcParams['axes.unicode_minus']=False # 正常显示负号2、运行过程中不显示绘图import matplotlibmatplotlib.use('Agg') # 不显示绘图import matplotlib.pyplot as plt这里需要注意,matplotlib.use('Agg')需要在导入pyplot前
2021-07-13 11:44:57 420
原创 pytorch中几个常见的需要重写的类
文章目录1 Dataset类2 自定义transform3 自定义网络结构由于是初学者,目前在学习过程中遇到的就以上三类,如果还有其他的话欢迎补充。1 Dataset类有时候需要使用我们自己的数据集,而非pytroch自带的数据集,这时候就有必要改写Dataset类了。相关操作见 Dataset类的改写,里面写得比较详细了,摘录几句比较重要的话。当我们集成了一个 Dataset类之后,我们需要重写 __len__ 方法,该方法提供了dataset的大小; __getitem__ 方法, 该方法支持
2021-04-08 11:29:47 1051
原创 解决tensorflow_gpu-2.3.1 出现“Could not load dynamic library ‘cudart64_101.dll‘的问题
先上问题import tensorflow as tf2020-11-30 09:54:16.112235: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found2020-11-30 09:54:16.112420: I tensorflow/stream_
2020-11-30 10:48:33 833
原创 Python语言Codewars实战——Sudoku Solution Validator(4 kyu)
Description:Sudoku BackgroundSudoku is a game played on a 9x9 grid. The goal of the game is to fill all cells of the grid with digits from 1 to 9, so that each column, each row, and each of the nine 3x3 sub-grids (also known as blocks) contain all of the
2020-11-22 11:04:30 416
原创 Python实战——VAE的理论详解及Pytorch实现
2.1 设定优化目标这一部分引入是因为一个问题:在通过采样的方法(蒙特卡洛法)计算下面这个式子的时候可不可以走捷径(shortcut)?实际上(in practice),对大多数的潜变量zzz而言,P(X∣z)P(X|z)P(X∣z)都是nearly zero的,因此它们对我们估计P(X)P(X)P(X)是没啥用的。这里就涉及到了VAE的核心思想了:尽量只采样那些对生成XXX 有贡献的zzz,然后用它们估计P(X)P(X)P(X) 。那么问题来了,从哪个分布里面去采样才能达到这个目的呢?不妨假设
2020-11-18 18:39:21 34128 18
转载 机器学习小知识——神经网络的L1和L2正则化
有时候在求解规划问题时,我们想要让得到的解满足一定的条件,换句话说,如果得到的解不能满足一定的条件我们更加倾向于拒绝它,而且这种倾向还是比较大的。这种情况在实际应用中比较常见,比如在准备出去旅行时,我们肯定不太希望背包里面放置特别重的东西,这时候就可以加一个条件,如果物品的重量大于一个给定的临界值,那么它的价值将大大降低,而这种大大降低可以通过给其添加一个很大的系数实现。同样的,在求解神经网络损失函数的最小值时,我们希望自变量权重向量www满足一定的条件,如果不满足,就给其狠狠地惩罚一下。这时候我们就会在
2020-11-05 18:03:04 2884
原创 Error loading “D:\Coding\Anaconda\lib\site-packages\torch\lib\asmjit.dll“
OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\chunc\anaconda3\lib\site-packages\torch\lib\asmjit.dll" or one of its dependencies.这个问题简直坑人,我在CSDN等国内的博客网站找的解决办法都是更新numpy,可谁知numpy没更新好,我的Spyder倒是莫名其妙地卸了,弄的我只能重装Anaco
2020-11-02 18:51:00 13716 13
原创 MATLAB实战——微分方程组的解法之欧拉法与4阶龙格库塔法
实现:%%Question 1 part(b)clear all;clc;t0 = 0;x0 = 1/2;dt = 0.1;tf = 1;t_range = t0:dt:tf;x_EU = zeros(1,length(t_range));x_EU(1)= x0;x_RK = zeros(1,length(t_range));x_RK(1)= x0;for k = 1:length(t_range) - 1 x_EU(k+1) = euler_scheme(x_EU...
2020-10-31 16:35:23 2387 3
原创 R语言Codewars实战——Sum by Factors(4kyu)
Description:Given an array of positive or negative integersI= [i1,..,in]you have to produce a sorted array P of the form[ [p, sum of all ij of I for which p is a prime factor (p positive) of ij] ...]P will be sorted by increasing order of the prime nu
2020-08-19 14:03:08 417
原创 R语言Codewars实战——Best travel(5kyu)
Description:John and Mary want to travel between a few towns A, B, C … Mary has on a sheet of paper a list of distances between these towns. ls = [50, 55, 57, 58, 60]. John is tired of driving and he says to Mary that he doesn’t want to drive more than t
2020-08-18 22:57:01 855
原创 R语言Codewars实战——Exponentials as fractions(4kyu)
Description:The aim is to calculate exponential(x) (written exp(x)in most math libraries) as an irreducible fraction, the numerator of this fraction having a given number of digits.We call this function expand, it takes two parameters, x of which we want
2020-08-18 18:24:55 515
原创 R语言Codewars实战——Fibo akin(5kyu)
Description:Be u(n) a sequence beginning with:u[1] = 1, u[2] = 1, u[3] = 2, u[4] = 3, u[5] = 3, u[6] = 4,u[7] = 5, u[8] = 5, u[9] = 6, u[10] = 6, u[11] = 6, u[12] = 8,u[13] = 8, u[14] = 8, u[15] = 10, u[16] = 9, u[17] = 10, u[18]
2020-08-17 00:32:16 326
原创 R语言Codewars实战——Twice linear(4kyu)
Consider a sequence u where u is defined as follows:The number u(0) = 1 is the first one in u.For each x in u, then y = 2 * x + 1 and z = 3 * x + 1 must be in u too.There are no other numbers in u.Ex: u = [1, 3, 4, 7, 9, 10, 13, 15, 19, 21, 22, 27, …]
2020-08-16 22:34:34 336
原创 R语言Codewars实战——Number of trailing zeros of N!(5kyu)
Description:Write a program that will calculate the number of trailing zeros in a factorial of a given number.N! = 1 * 2 * 3 * … * NBe careful 1000! has 2568 digits…For more info, see: http://mathworld.wolfram.com/Factorial.htmlExampleszeros(6) = 1#
2020-08-16 11:34:30 318
原创 R语言Codewars实战——Rainfall
说明:这道题是真难到我了,主要是我不清楚怎么把字母之间的数字匹配出来,我初始的时候想的是正则表达式,但是R语言的正则表达式与我在python中学到的不同,且更加麻烦复杂,再者我又对正则表达式一知半解的,脑子真就慢慢变得迷糊了,直接看了别人的解法(整半天经验没变化,难受啊)。Description:data and data1 are two strings with rainfall records of a few cities for months from January to December.
2020-08-14 17:46:40 408
原创 R语言Codewars实战——Last digit of a large number(5kyu)
Description:Define a function that takes in two non-negative integers a and b and returns the last decimal digit of a^b. Note that a and b may be very large!For example, the last decimal digit of 9^7 is 9, since 9^7 = 4782969. The last decimal digit of (
2020-08-13 23:47:06 1292
原创 R语言Codewars实战——Help the bookseller !(6kyu)
Description:A bookseller has lots of books classified in 26 categories labeled A, B, ..., Z. Each book has a code c of 3, 4, 5 or more characters. The 1st character of a code is a capital letter which defines the book category.In the bookseller’s stockli
2020-08-13 11:03:24 316
原创 MATLAB与Python实战——二维向量与等高线的绘制
代码前部分是求解偏微分方程,后面一部分是绘图。在绘图的过程中,主要难点有两个:第一, 如何使用python或MATLAB绘制等高线以及热力图,并把它们叠加在一张图上。第二,如何使用python或MATLAB绘制二维的向量图。MATLAB实现代码:% Solution of 2D Stokes and continuity equations with finite differences% on a regular grid using stream function - vorticit
2020-08-12 16:56:08 1424
原创 MATLAB实战——回归分析、回归诊断与异常值的查找
例1clear,clc%% 数据准备x1 = [7 1 11 11 7 11 3 1 2 21 1 11 10]';x2 = [26,29,56,31,52,55,71,31,54,47,40,66,68]';x3 = [6 15,8,8,6,9,17,22,18,4,23,9,8]';x4 = [60,52,20,47,33,22,6,44,22,26,34,12,12]';y = [78.5 74.3 104.3 87.6 95.9 109.2 102.7 72.5 93.1 115.9
2020-07-10 20:30:35 7432 2
单总体与多总体ANOVA方差分析.zip
2020-04-13
基于Python的两例词云实战代码与数据.zip
2020-03-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人