- 博客(133)
- 资源 (4)
- 收藏
- 关注
原创 python cv2 罗德里格斯公式
https://blog.csdn.net/a645061612/article/details/131666369你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。我们对Markdown编辑器进行了一些功能拓展与语法支持,除了标准的Markdown编辑器功能,我们增加了如下几点新功能,帮助你用它写博客:撤销:Ctrl/Command + Z重做:Ctrl/Command + Y加
2024-12-01 12:14:52 737
原创 神经网络及其技巧
attentionhttps://blog.csdn.net/zimiao552147572/article/details/105893587/BahdanauAttention注意力机制:基于seq2seq的西班牙语到英语的机器翻译任务、解码器端的Attention注意力机制、seq2seq模型架构
2022-05-30 18:32:04 243 1
原创 pytorch 数据操作技巧
aimport torchalign = torch.FloatTensor([3,4,8]).to(torch.long)torch.repeat_interleave(torch.eye(3),align,dim=1)tensor([[1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],[0., 0., 0., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0.],[0., .
2021-10-10 10:58:00 162
原创 pytorch_lightning
trainimport torchfrom torch.nn import functional as Ffrom torch import nnfrom pytorch_lightning.core.lightning import LightningModuleimport pytorch_lightning as plimport osimport torchimport torchvisionimport torch.nn as nnimport torch.nn.func.
2021-09-23 15:31:41 291
原创 textgrid
from praatio import tgiofrom pydub import AudioSegmentimport osimport globdef create_word_ctm(): with open("datasets/BBSpeech-1.0/metadata.csv",'r') as fp: lines1 = fp.readlines() words = {} phones = {} for i in lines1:
2021-09-10 17:00:49 543
原创 tensorflow rnn
tf.nn.rnn_cell.MultiRNNCell新版tf.contrib.rnn.MultiRNNCell tf.nn.rnn_cell.MultiRNNCellstate_is_tuple:true,状态Ct和ht就是分开记录,放在一个tuple中,接受和返回的states是n-tuples,其中n=len(cells)# encoding:utf-8import tensorflow as tfbatch_size=10depth=128inputs=tf.Var.
2021-08-27 11:41:48 117
原创 tf.nn.ctc
batch_size=4, max_time=5, and labels_length=[5,4,3,2].import tensorflow as tflabels = tf.Variable([[4, 3, 1, 2, 5], [2, 3, 4, 1, 0], [1, 2, 3, 0, 0], [5, 4, 0, 0, 0]], tf.int32)with tf..
2021-05-27 13:43:33 134
原创 C++17 新特性总结 [转]
https://blog.csdn.net/baidu_41388533/article/details/110460442
2021-05-20 10:33:55 159
原创 bash 使用privoxy
永久修改sudo apt-get install privoxysudo vim /etc/privoxy/config去掉forward-socks5t行注释,改成单位的ip:portforward-socks5t / 192.168.0.119:3128 .重启服务sudo /etc/init.d/privoxy restartbash中一次使用export http_proxy="192.168.0.119:3128"export https_proxy="192.1
2021-05-18 10:58:27 35 1
原创 pynini
编译bazel build ...注:bazel clean # 不会删除外部依赖bazel clean --expunge # 会删除外部依赖bazel clean --expunge --asyncbazel buildbazel build : # 在BUILD所在的package目录下执行,编译指定的targetbazel build :all # 编译该package下的所有targetbazel build … # 编译该package下的所有targetbaze.
2021-04-24 21:37:51 1127
原创 tensorflow 梯度修剪
tf.clip_by_normimport tensorflow as tfw = tf.Variable(2,dtype=tf.float32)x = tf.Variable(3,dtype=tf.float32)loss = w*x*xoptimizer = tf.train.GradientDescentOptimizer(0.1)grads_and_vars = optimizer.compute_gradients(loss,[w,x])grads = tf.gradients.
2021-04-01 16:19:42 180
原创 warpctc
warpctc_pytorchimport torchimport warpctc_pytorch as warp_ctcfrom torch.autograd import Functionfrom torch.nn import Modulefrom ._warp_ctc import *__version__ = '0.1.1'def _assert_no_grad(tensor): assert not tensor.requires_grad, \ .
2021-02-20 18:28:09 179
原创 kaldi
docker操作https://blog.csdn.net/weixin_39946300/article/details/110802648?utm_medium=distribute.pc_relevant_download.none-task-blog-baidujs-1.nonecase&depth_1-utm_source=distribute.pc_relevant_download.none-task-blog-baidujs-1.nonecase
2021-01-23 18:31:02 133
原创 cuda安装
centos7cuda10sudo rpm -i cuda-repo-rhel7-10-0-local-10.0.130-410.48-1.0-1.x86_64.rpmsudo yum clean allsudo yum install cuda
2021-01-15 17:12:32 216
原创 cuda
Stream像素色彩空间转换,将一张7680x4320的8-bit BRGA图像转成同样尺寸的8-bit YUV完整代码(需要NVidia GPU,本文中的测试使用CUDA 10.0):#include <vector>#include <random>#include <iostream>#include <cuda.h>#include <cuda_runtime.h>#ifdef DEBUG#define CUDA.
2021-01-10 20:09:01 204
原创 C/C++ 调试工具
cppcheckcppcheck主要用于对C/C++源代码进行分析检查的一个开源工具,可以用来检测未使用的变量、越界访问、内存泄漏等问题。cppcheck --enable=all NAME.cppgcovgcov是伴随gcc发布的一个代码覆盖率检查工具,可以用来检查代码中各个语句的执行次数,查看代码执行逻辑,方便后期对代码的优化。在 gcc/g++ 的编译选项中添加两个选项 -fprofile-arcs -ftest-coverage运行可执行程序,生成两个包含代码覆盖信息的两个文.
2021-01-02 15:55:58 889
原创 C/C++ iterator
std::iteratortemplate< class Category,class T,class Distance = std::ptrdiff_t,class Pointer = T*,class Reference = T& > struct iterator;std::iterator 的模板参数:Category: 类型为 iterator_category,表示迭代器的种类,共有5类:T :类型为 value_type, 可以通过解除引用迭代器获得.
2021-01-02 15:34:43 425 1
原创 C/C++ 多线程
atomic#include <atomic>#include <thread>#include <assert.h>std::atomic<bool> x,y;std::atomic<int> z;void write_x_then_y(){ x.store(true,std::memory_order_relaxed); // 1 y.store(true,std::memory_order_relaxed).
2020-12-29 16:18:10 98
原创 C/C++ stdarg
#include <stdarg.h>#include <stdio.h>int AveInt(int,...);int main(){ printf("%d\n",AveInt(2,2,3)); printf("%s\n","--------------------------"); printf("%d\n",AveInt(4,2,4,6,8)); return 0;}int AveInt(int v,...){ int
2020-12-24 14:48:34 251
原创 yule-walker
1https://blog.csdn.net/naruhina/article/details/107013196https://zhuanlan.zhihu.com/p/64933417
2020-12-23 14:19:22 444
原创 scipy
lpcimport librosaimport scipy.io.wavfile as swavimport numpy as npimport matplotlib.pyplot as plt import scipy y, sr = librosa.load("test0.wav", offset=3,duration = 0.02) a = librosa.lpc(y, 2) #b = [0] + -1 * a[1:] b = [-2,1] .
2020-12-22 16:51:50 152
原创 nccl
expimport torchimport torch.distributed as distimport argparsefrom time import sleepfrom random import randintfrom torch.multiprocessing import Processdef initialize(rank, world_size, ip, port): dist.init_process_group(backend='nccl', init_m.
2020-12-22 10:16:03 293
原创 C/C++ map
#include <iostream>#include <map>#include <sstream>#include <string>#include <vector>#include <algorithm>#include <functional> using namespace std; struct FoundByValue { FoundByValue(string str):_s(
2020-12-05 14:19:00 163
原创 boost之thread_specific_ptr
#include <iostream>#include <time.h>#include <boost/random/uniform_int_distribution.hpp>#include <boost/random/mersenne_twister.hpp>#include <boost/thread.hpp>#include <boost/thread/tss.hpp> // thread_specific_ptr
2020-12-02 22:32:55 360
原创 docker
安装基本使用网络docker network lsdocker run -it --net host centos:centos7 /bin/bash
2020-11-02 14:35:32 239
原创 CPython
数据类型#include <stdio.h>#include <Python.h>using namespace std;PyObject* none_object(){ Py_RETURN_NONE; // 不需要自己return}int main() { // 初始化Python虚拟机 Py_Initialize(); // 判断Python虚拟机是否成功 if (Py_IsInitialized() == 0){ .
2020-10-24 00:01:14 293
原创 C/C++ 命令参数解析
exp1main.cpp#include <stdio.h>#include <stdlib.h>#include "argsh.h"int main(int argc, char* argv[]){ int tmp = 4; while( (tmp = getopt(argc, argv, "abck")) != -1 ) { printf("00000000\n"); printf("tmp=%.
2020-10-23 16:08:44 368
原创 cuda
exp1#include <cuda.h>#include <iostream>struct HostObject { __host__ int value() const { return 42; }};struct DeviceObject { __device__ int value() const { return 3; }};template <typename T>__host__ __device__i
2020-10-13 13:59:07 442 1
原创 C/C++ pthread
std::mutex#include <iostream>#include <chrono>#include <mutex>#include <thread>struct CriticalData{ std::mutex mut;};void deadLock(CriticalData& a, CriticalData& b){ std::unique_lock<std::mutex>guard1(a.
2020-09-30 14:44:26 284
原创 C/C++ std::function
#include <iostream>#include <functional>#include <memory>class classA{ typedef std::function<void(int i)> callback_t; public: classA() {} ~classA() {} void handle(int i) { std::cout << "classA::handle " &l
2020-09-24 15:31:34 220
原创 tensorflow编译
对tensorflow-gpu10源码进行编译报错ERROR: Config value cuda is not defined in any .rc file问题原因:bazel版本过高。解决办法:tf1.10的构建版本时需要使用bazel 0.15,换成了bazel 0.15版本构建问题解决。r1.11 bazel版本0.18 ...
2020-09-13 17:48:34 251
原创 C/C++ 结构体
#include <iostream>struct LogMessageEnvelope{ enum Severity{ kAssertFailed = -3, kError = -2, kWarning = -1, kInfo = 0 }; int severity;};int A(LogMessageEnvelope::Severity severity){ std::cout <
2020-08-26 14:46:52 254
10-batches-py.tar.gz
2020-07-17
VC6LineNumberAddin.rar
2020-04-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人