- 博客(21)
- 资源 (385)
- 问答 (103)
- 收藏
- 关注
原创 python3 pickle 报错 'ascii' codec can't decode byte
改成这样pickle.load(file_name,mode="rb"),encoding='bytes')
2019-03-26 16:57:46 2014
原创 encoder-decoder结构的模型做text-generation任务的数据准备
训练时:encoder input:[A, B, C, D, EOS]target:[E, F, G, H, EOS]decoder input:[BOS, E, F, G, H]预测时:encoder input:[A, B, C, D, EOS]decoder input:[BOS]
2019-03-26 14:40:51 308
原创 tensor2tensor 做 language model 的理解
language model(LM)没有用encoder,只用了decoder,在decoder代码里,transformer_prepare_decoder方法里调用了shift_right_3d方法使decode_input的sequence向右错一位,即target [1,2,3,4]input [0,1,2,3]正好是预测下一个词...
2019-03-22 10:09:12 425
原创 3d和2d的tensor的shift方法实现
def shift_right_3d(x, pad_value=None): """Shift the second dimension of x right by one.""" if pad_value is None: shifted_targets = tf.pad(x, [[0, 0], [1, 0], [0, 0]])[:, :-1, :] else: sh...
2019-03-21 18:22:09 830
原创 tf.pad 实例 与 使用
import tensorflow as tftf.enable_eager_execution()x = tf.Variable(initial_value=[[1,2,3],[4,5,6]])padded = tf.pad(x, [[0, 0], [1, 0]])print(padded)padded = tf.pad(x, [[0, 0], [0, 1]])print(padde...
2019-03-21 18:19:33 235
原创 tensor2tensor 在sess.run时查看feed进去时的数据的值,以及查看输出的数据的值
在Python36\Lib\site-packages\tensorflow_estimator\python\estimator\estimator.py文件里搜mon_sess.run关键字,可在estimator.py文件的predict方法和_train_with_estimator_spec定位到,这样也只能看到部分内容,因为是采用tf.data接口喂数据,所以看不到直接的feed...
2019-03-21 15:38:00 659
原创 tensor2tensor decode报错,模型restore有问题
t2t_decoder的checkpoint_path参数要填成类似这样:flags.DEFINE_string("checkpoint_path", default="../../t2t_train/cn_lm/model.ckpt-53000", help="Path to the model checkpoint. Overrides output_dir.")...
2019-03-21 12:04:28 390
原创 tensor2tensor decode时报错 Fast decoding only supports a single shard.
把flags.py的worker_gpu参数改为1
2019-03-21 11:10:03 297 1
原创 tensorflow 取到/打印 tensor名字
.name即可for variable in tf.trainable_variables(): print(variable.name)
2019-03-20 10:35:50 2836 1
原创 tensorflow 打印每个tensor的参数量
定义完graph后面加上 from functools import reduce from operator import mul def get_num_params(): num_params = 0 for variable in tf.trainable_variables(): shape = varia...
2019-03-20 10:31:31 2021
原创 tensor2tensor 添加一个problem
仿照data_generators文件夹里的比如ptb.py写一个新的比如ptb2.py,然后在all_problems.py写上即注册,把flags.py文件里的problem参数按规律改成ptb2.py里的problem名字...
2019-03-19 18:51:02 327
转载 python dict按value排序
https://stackoverflow.com/questions/613183/how-do-i-sort-a-dictionary-by-valuesort_tuple_list = sorted([(value,key) for (key,value) in mydict.items()])
2019-03-13 15:15:56 2435
原创 rollout的意思
SeqGAN和LeakGAN里都提到这个东西,感觉就是 用上一个词的输出作为下一个要生成的词的输入 一个一个生成一句话 的意思
2019-03-13 11:45:33 2902
原创 pytorch torch.gather 实例
import torchinput_tensor = torch.tensor([[1,2],[3,4],[5,6]])gather_input = torch.tensor([[0,0],[1,0],[1,1]])output_tensor = torch.gather(input_tensor, 1, gather_input)print(output_tensor)tensor(...
2019-03-08 17:58:12 487
原创 pytorch,nonzero 实例 使用
import torchinput_tensor = torch.tensor([1,2,3,4,5])mask = input_tensor>3print(mask)indexes = mask.nonzero().squeeze()print(indexes)tensor([0, 0, 0, 1, 1], dtype=torch.uint8)tensor([3, 4])...
2019-03-08 17:48:15 1726
原创 pytorch,筛选出一定范围的值
import torchinput_tensor = torch.tensor([1,2,3,4,5])print(input_tensor>3)mask = (input_tensor>3).nonzero()print(mask)print(input_tensor.index_select(0,mask))tensor([0, 0, 0, 1, 1], dtype=...
2019-03-08 17:47:04 4762
原创 pytorch,初始化tensor
import torchinput_tensor = torch.tensor([1,2,3,4,5])input_tensor = torch.tensor([[1,2,3,4,5],[6,7,8,9,10]])
2019-03-08 17:24:52 2660
原创 pytorch,index_select实例
import torchinput_tensor = torch.tensor([1,2,3,4,5])print(input_tensor.index_select(0,torch.tensor([0,2,4])))input_tensor = torch.tensor([[1,2,3,4,5],[6,7,8,9,10]])print(input_tensor.index_select...
2019-03-08 17:23:30 3342
原创 pytorch,torch.full 实例
>>> torch.full((2, 3), 3.141592)tensor([[ 3.1416, 3.1416, 3.1416], [ 3.1416, 3.1416, 3.1416]])
2019-03-08 14:46:15 9827 2
huggingface.co/Salesforce/blip-image-captioning-base
2024-08-22
Qwen2-7B 的 model-00004-of-00004.safetensors 的2/2
2024-07-29
Qwen2-7B 的 model-00004-of-00004.safetensors 的1/2
2024-07-29
Qwen2-7B 的 model-00003-of-00004.safetensors 的2/2
2024-07-29
Qwen2-7B 的 model-00003-of-00004.safetensors 的1/2
2024-07-29
Qwen2-7B 的 model-00002-of-00004.safetensors 的2/2
2024-07-28
Qwen2-7B 的 model-00002-of-00004.safetensors 的1/2
2024-07-28
Qwen2-7B 的 model-00001-of-00004.safetensors 的2/2
2024-07-28
Qwen2-7B 的 model-00001-of-00004.safetensors 的1/2
2024-07-28
Qwen2-7B-Instruct 的 model-00004-of-00004.safetensors 的2/2
2024-07-26
Qwen2-7B-Instruct 的 model-00004-of-00004.safetensors 的1/2
2024-07-26
Qwen2-7B-Instruct 的 model-00003-of-00004.safetensors 的2/2
2024-07-26
Qwen2-7B-Instruct 的 model-00003-of-00004.safetensors 的1/2
2024-07-26
Qwen2-7B-Instruct 的 model-00002-of-00004.safetensors 的2/2
2024-07-26
Qwen2-7B-Instruct 的 model-00002-of-00004.safetensors 的1/2
2024-07-26
Qwen2-7B-Instruct 的 model-00001-of-00004.safetensors 的2/2
2024-07-25
Qwen2-7B-Instruct 的 model-00001-of-00004.safetensors 的1/2
2024-07-25
torch-2.3.0+cu118-cp38-cp38-linux-x86-64.whl
2024-06-24
meta-llama-3-8b-instruct 的 model-00004-of-00004.safetensors
2024-05-29
meta-llama-3-8b-instruct 的 model-00003-of-00004.safetensors 的3/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00003-of-00004.safetensors 的2/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00003-of-00004.safetensors 的1/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00002-of-00004.safetensors 的3/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00002-of-00004.safetensors 的2/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00002-of-00004.safetensors 的1/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00001-of-00004.safetensors 的3/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00001-of-00004.safetensors 的2/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00001-of-00004.safetensors 的1/3
2024-05-29
huggingface的bert-base-chinese
2024-03-05
huggingface的bert-base-uncased
2024-03-03
自动驾驶,如何得到方向盘转动的ground truth?
2024-03-18
AlphaGo能超越人类,因为训练时 对于模型的每个输入,都有一个100%正确的答案?
2024-01-16
其实LLM/ChatGPT是否在距离AlphaGo式AI越来越远?
2024-01-16
技术上,ChatGPT要成为 AI医生/AI律师/AI教师 还欠缺哪些能力?
2024-01-11
数学 是且仅是 一种语言和一种工具,不是科学的全部?
2023-12-14
哪些时候用CUDA编程更好?
2023-12-14
用RL做NLP,和 根据那条数据的reward重新标注那条数据 有什么区别?
2022-05-07
没有物理机器人载体,如何在模拟环境里的进行学习和研究机器人?
2022-04-28
2022年了,USB式GPU有哪些进展?
2022-04-28
2022年了,有哪些稳压deepfm的CTR模型?
2022-04-01
CTR模型,如果上线了没效果,这时可以进行哪些分析工作?以及有无必要投入大量时间分析?
2022-03-24
算法工程师如何应对做算法策略的不确定性;比如没效果,这时绩效怎么保证?
2022-03-01
CTR模型必须要有一个测试数据集吗? 训练数据集和测试数据集是同一个,可以吗?
2022-02-25
为啥我感觉现在机器学习模型就是一种模糊匹配工具or相似识别工具?
2022-02-16
因果推断技术靠谱吗,感觉里面的影响因素太多了,所以能实际解决落地问题吗?
2022-02-08
XGB/GBDT/决策树,得出特征重要性的原理是什么?
2022-02-08
强化学习是不是无人驾驶的未来?
2022-02-01
GAN生成图像,弄一个discriminator ,和无D直接生成,区别是?
2022-02-01
哪些互联网公司的管理职级和专业职级是分开的?
2022-01-22
CTR模型的AUC如果比较高,是否其实只是 因为复购行为带来的AUC虚高?
2022-01-17
CTR模型的本质是不是算出 user的哪些特征和item的哪些特征 最匹配?
2022-01-08
人工智能的因果学习(Causal Learning)到底想解决什么问题?
2021-12-17
BYOL里stop-gradient的作用是什么?
2021-12-01
马上2022年了,强化学习+NLP 有了哪些突破?
2021-11-26
马上2022年了,pointer-network现在看来的作用是什么?
2021-11-26
总被主管说文档写的不好怎么办?
2021-11-18
NER任务只有一个类的情况下,BME或者Yes-No的数据预处理方式对结果有影响吗?
2021-11-08
学好数学对于编程的真实增益的性价比到底如何?
2021-11-03
学好数学对于编程的真实增益到底是多少?
2021-11-03
如果说每一个数学公式都在描述一件事情,那么数学公式的推导,是在做什么?
2021-10-26
每个物理公式是否都是在【描述】一个事情?
2021-10-12
求通俗讲讲数学或理论物理进行研究的细节,复杂公式是不是也都是由基础公式而来?
2021-09-14
TA创建的收藏夹 TA关注的收藏夹
TA关注的人