摘要: 已知均值$\bm{\mu}*$ 和协方差矩阵$\bm{\Sigma}*$, 得到样本 \(\bm{\theta} \sim N(\bm{\mu}^*, \bm{\Sigma}^*)\) Matlab 实现代码: % Example of sampling from multivariate Gaus 阅读全文
posted @ 2021-09-28 14:33 pas_a_pas 阅读(307) 评论(0) 推荐(0)
摘要: 显卡: NVIDIA 2070 super 版本配置: 操作系统: Ubuntu 18.04 LTS 显卡驱动*: Driver Version: 440.44 CUDA 版本: CUDA Toolkit 10.1 update2, (cuda_10.1.243_418.87.00_linux.ru 阅读全文
posted @ 2021-09-20 17:49 pas_a_pas 阅读(853) 评论(0) 推荐(0)
摘要: 最长公共子串 和 最长公共子序列 子串必须连续, 子序列不要求连续,次序不变即可 最长公共子串 dp[i][j] 表示以A[i]为结尾的A 的子串 和 以B[j]为结尾的B 的子串的 最长公共子串的长度 初始化: if A[0] == B[0]: dp[0][0] = 1 else: dp[0][0 阅读全文
posted @ 2021-09-15 17:43 pas_a_pas 阅读(64) 评论(0) 推荐(0)
摘要: LC785.判断二分图 LeetCode 785 方法一: BFS + 染色 class Solution: def isBipartite(self, graph: List[List[int]]) -> bool: # BFS from collections import deque n = 阅读全文
posted @ 2021-09-15 11:55 pas_a_pas 阅读(136) 评论(0) 推荐(0)
摘要: **返回的是整型, e返回的是浮点型 阅读全文
posted @ 2021-09-07 08:07 pas_a_pas 阅读(220) 评论(0) 推荐(0)
摘要: # 如无特殊要求,可以直接使用pow(x, y, mod) 函数 def fast_power(x, y, z): res = 1 while y: if y&1 == 1: # y&1 是取y的二进制最后一位, 用来判断是否为奇数 res = res*x%z y = y>> 1 # 位运算,也就是 阅读全文
posted @ 2021-09-06 22:39 pas_a_pas 阅读(158) 评论(0) 推荐(0)
摘要: class UnionFind: def __init__(self, n): self.root = [i for i in range(n)] self.rank = [1]*n self.cnt = n # 用来统计孤岛个数 def find(self, x): if x == self.ro 阅读全文
posted @ 2021-09-04 22:22 pas_a_pas 阅读(57) 评论(0) 推荐(0)
摘要: Ubutnu 假死 显卡 persistence mode 阅读全文
posted @ 2021-06-29 14:27 pas_a_pas 阅读(257) 评论(0) 推荐(0)