11 2020 档案

摘要:apt purge opera-stable rm -vrf ~/{.cache,.config}/opera 阅读全文
posted @ 2020-11-27 23:31 2021年的顺遂平安君 编辑
摘要:echo foo_{0..54}.jpg echo foo_{0..54..2}.jpg 以下为转载 1.1、通配符 “*”:匹配任意字符串,包括空字符串,不包含对“/”字符的匹配。 “?”:匹配任意单个字符,不能匹配“/”字符。 1.2、字符类 “[abc]”:匹配“a”或者“b”或者“c”字符。 阅读全文
posted @ 2020-11-27 20:52 2021年的顺遂平安君 编辑
摘要:使用 f-string print(f"y1/y2: {y1:.6e}/{y2:.6e}") # y1/y2: 4.282000e-11/1.562123e-10 使用% print('%d %s cost $%.2f' % (6, 'bananas', 1.74)) # 6 bananas cos 阅读全文
posted @ 2020-11-27 18:55 2021年的顺遂平安君 编辑
摘要:TensorFlow 每次运行的时候都会弹出类似下面的调度信息 I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally I tensorflow/str 阅读全文
posted @ 2020-11-22 20:44 2021年的顺遂平安君 编辑
摘要:In [22]: y_true = [[0], [1]] In [23]: y_pred = [[0.9], [0.9]] In [24]: tf.keras.losses.binary_crossentropy(y_true, y_pred) Out[24]: <tf.Tensor: shape= 阅读全文
posted @ 2020-11-21 17:26 2021年的顺遂平安君 编辑
摘要:relig_income #> # A tibble: 18 x 11 #> religion `<$10k` `$10-20k` `$20-30k` `$30-40k` `$40-50k` `$50-75k` `$75-100k` #> <chr> <dbl> <dbl> <dbl> <dbl> 阅读全文
posted @ 2020-11-21 17:23 2021年的顺遂平安君 编辑
摘要:find . -type f -iname \*.jpg -delete -type 文件类型 -iname 区分大小写 -delete 对符合条件的文件执行删除命令 最好先运行不带-delete的版本查看符合条件的文件。 阅读全文
posted @ 2020-11-21 17:20 2021年的顺遂平安君 编辑
摘要:明明没有在跑大程序,苹果的风扇还是狂转不停。看来传感器不是特别灵敏。找到一个可以手动调节的软件,可以保持中等转速。 https://crystalidea.com/macs-fan-control/download 世界瞬间清净。 阅读全文
posted @ 2020-11-21 17:19 2021年的顺遂平安君 编辑
摘要:Tidyverse selections implement a dialect of R where operators make it easy to select variables: : for selecting a range of consecutive variables. ! fo 阅读全文
posted @ 2020-11-21 17:17 2021年的顺遂平安君 编辑
摘要:namespace ‘glue’ is imported by ‘tidyselect’, ‘dplyr’ so cannot be unloaded 报错原因是dplyr和tidyselect两个包所要求的glue版本不同。把glue更新到最新版本即可,可以需要源码编译。 阅读全文
posted @ 2020-11-21 17:16 2021年的顺遂平安君 编辑
摘要:最忠实Leo Breiman算法的版本是 randomForest,但是这个库不支持并行,性能也比较差。 有两个优化后的替代版本,都支持并行计算。 ranger rborist 阅读全文
posted @ 2020-11-21 17:14 2021年的顺遂平安君 编辑
摘要:$R^2$不止一种定义方式,这里是scikit-learn中所使用的定义。 As such variance is dataset dependent, R² may not be meaningfully comparable across different datasets. Best pos 阅读全文
posted @ 2020-11-21 17:12 2021年的顺遂平安君 编辑
摘要:官方例子如下, rescale01 <- function(x) { rng <- range(x, na.rm = TRUE) (x - rng[1]) / (rng[2] - rng[1]) } df <- tibble(x = 1:4, y = rnorm(4)) df %>% mutate( 阅读全文
posted @ 2020-11-21 17:11 2021年的顺遂平安君 编辑
摘要:out-of-bag prediction Created: Jun 29, 2020 12:22 PM Updated: Jun 29, 2020 12:28 PM https://stackoverflow.com/questions/25153276/difference-of-predict 阅读全文
posted @ 2020-11-21 17:09 2021年的顺遂平安君 编辑
摘要:两个主要功能, 替换NA x <- c(2, 1, NA, 5, 3, NA) # Create example vector coalesce(x, 999) # Apply coalesce function # 2 1 999 5 3 999 x中的NA被替换成了999。 对比并替换 这个功能 阅读全文
posted @ 2020-11-21 17:07 2021年的顺遂平安君 编辑
摘要:case_when 要点有两个 不匹配的时候会返回 NA,而不是保持不变 根据顺序进行条件判断,顺序很重要 下面这段代码, x <- 1:50 case_when( x %% 35 == 0 ~ "fizz buzz", x %% 5 == 0 ~ "fizz", x %% 7 == 0 ~ "bu 阅读全文
posted @ 2020-11-21 17:05 2021年的顺遂平安君 编辑
摘要:Filtering joins filter rows from x based on the presence or absence of matches in y: semi_join() return all rows from x with a match in y. anti_join() 阅读全文
posted @ 2020-11-21 17:04 2021年的顺遂平安君 编辑
摘要:bind_rows & bind_cols 这两个命令是do.call(rbind, dfs)和do.call(cbind, dfs)的代替,使用起来更有效率。 one <- starwars[1:4, ] two <- starwars[9:12, ] bind_rows(one, two) bi 阅读全文
posted @ 2020-11-21 17:02 2021年的顺遂平安君 编辑
摘要:macOS 10.12 下使用pip install opencv-python安装OpenCV后会报错,主要是版本兼容问题。不想折腾macOS,可以安装 3.4.9.33 这个版本的OpenCV这个兼容版本。 阅读全文
posted @ 2020-11-21 16:58 2021年的顺遂平安君 编辑
摘要:summarise() regrouping output 警告 这里讨论的是return的属性,而不是group_by本身。以下面代码为例,summarise之后给出的警告信息是指,这里return的tibble的atrribute中group_by参数只有homeword,没有species。也 阅读全文
posted @ 2020-11-21 16:55 2021年的顺遂平安君 编辑
摘要:只能说官方的命名有点太随意,使用上二者有点细微区别。 一般compile的时候,使用的是小写的binary_crossentropy y_true = [[0., 1.], [0., 0.]] y_pred = [[0.6, 0.4], [0.4, 0.6]] # Using 'auto'/'sum 阅读全文
posted @ 2020-11-21 16:54 2021年的顺遂平安君 编辑
摘要:官方说明书的例子其实特别简单明了, y_true = [[0., 1.], [0., 0.]] y_pred = [[0.6, 0.4], [0.4, 0.6]] # Using 'auto'/'sum_over_batch_size' reduction type. bce = tf.keras. 阅读全文
posted @ 2020-11-21 16:52 2021年的顺遂平安君 编辑
摘要:最近仔细看了一下sed命令,不得不感慨sed的强大功能,感觉能写半本书了。这能总结一些最常用的。 替换并打印在屏幕上 最常用的就是替换功能。 sed 's/foo/bar/g' 这条命令都比较熟,就是把所有foo替换成bar,但是前面的s和后面的g是什么意思? 更一般的写法其实是 sed 's/re 阅读全文
posted @ 2020-11-21 05:48 2021年的顺遂平安君 编辑
摘要:限制CPU使用率 cpulimit -l 20 App 上面代码会将App程序的CPU使用率限制在20%,可以使用htop查看。 如果程序正在运行,可以通过其PID来限制CPU使用,比如 cpulimit -l 20 -p 1234 会限制PID为1234的进程的CPU使用率。 限制CPU核心数 以 阅读全文
posted @ 2020-11-21 05:40 2021年的顺遂平安君 编辑
摘要:Python的Iterator可以同时打印信息 Updated: May 12, 2020 5:58 PM 今天看到一个Python Iterator的高级用法,之前并不知道,孤陋寡闻了。 def my_gen(): for i in range(10): print(f"This is {i}") 阅读全文
posted @ 2020-11-21 05:38 2021年的顺遂平安君 编辑
摘要:pandas有三个操作index的方法 reindex DataFrame.reindex(self, labels=None, index=None, columns=None, axis=None, method=None, copy=True, level=None, fill_value=n 阅读全文
posted @ 2020-11-21 05:37 2021年的顺遂平安君 编辑
摘要:第一次接触RNN很容易被数据处理弄糊涂,这里总结一下,总把每一步的处理结果都打印出来。 数据下载 shakespeare_url = "https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/in 阅读全文
posted @ 2020-11-21 05:36 2021年的顺遂平安君 编辑
摘要:在介绍卷积神经网络CNN的时候,大部分教材在介绍“卷积操作”的时候都与下面这张图类似的说明 这点让人很困惑,因为在数学上,卷积运算是这么定义的 \((f * g )(t) = \int_{0}^{t} f(\tau) g(t - \tau)\, d\tau\) 很明显,在与$f(\tau)$相乘的是 阅读全文
posted @ 2020-11-21 05:34 2021年的顺遂平安君 编辑
摘要:numpy.stack(list, axis=0 ) 或更简单地 numpy.vstack(list) 以上代码可以将list中的所有numpy.array进行合并,无需循环。 阅读全文
posted @ 2020-11-21 05:33 2021年的顺遂平安君 编辑
摘要:taskset --cpu-list 0,1,2,3 <app> 以上代码会将你的进程<app>绑定在4个CPU上运行,分别是0,1,2,3。 其他参数包括 SYNOPSIS taskset [options] [mask | list ] [pid | command [arg]...] OPTI 阅读全文
posted @ 2020-11-21 05:31 2021年的顺遂平安君 编辑
摘要:如果y是one-hot encoding格式,使用sparse_categorical_crossentropy [1,0,0] [0,1,0] [0,0,1] 如果y是整数,非one-hot encoding格式,使用categorical_crossentropy 1 2 3 阅读全文
posted @ 2020-11-21 05:30 2021年的顺遂平安君 编辑
摘要:tf.keras.layers.RNN( cell, return_sequences=False, return_state=False, go_backwards=False, stateful=False, unroll=False, time_major=False, **kwargs ) 阅读全文
posted @ 2020-11-21 05:29 2021年的顺遂平安君 编辑
摘要:网上有不少解释,包括下面这张图片 光靠图片理解还是不够,而且特别容易理解反了。这里用一个实例进行讲解。 一个非常简单的数据集,包含两个sample,3个features。 第一个sample: X1=1.0,X2=1.0, X3=1.0 第二个sample: X1=10.0,X2=10.0, X3= 阅读全文
posted @ 2020-11-21 05:27 2021年的顺遂平安君 编辑
摘要:AttributeError: module 'tensorflow_core._api.v2.config' has no attribute 'list_physical_devices' 应该是接口更新了,改成以下接口就不会报错了。 查看所有GPU tf.config.experimental 阅读全文
posted @ 2020-11-21 05:25 2021年的顺遂平安君 编辑
摘要:#include <iostream> #include "Eigen/Dense" #include "eigen_consts.H" #include "eigen_test.H" using namespace std; using namespace Eigen; int main() { 阅读全文
posted @ 2020-11-21 01:25 2021年的顺遂平安君 编辑

点击右上角即可分享
微信分享提示