首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏数理视界

    NumPy 基础

    ragged_array:', ragged_array.ndim) # print('数组中元素的总个数ragged_array:', ragged_array.size) # print('数组中元素的数据类型 ragged_array:', ragged_array.dtype) # print('整个数组在内存中所占的字节数ragged_array:', ragged_array.nbytes) # print , ragged_array.shape) # print('转换为 Python 内置的列表类型ragged_array:', ragged_array.tolist()) # have a ragged _2:', ragged_array_2.ndim) print('数组中元素的总个数ragged_array_2:', ragged_array_2.size) print('数组中元素的数据类型ragged_array ragged_array_2:', ragged_array_2.itemsize) print('获取数组的形状(各维度上元素的个数情况)ragged_array_2:', ragged_array_

    33833编辑于 2025-03-31
  • 来自专栏Hank’s Blog

    [已解决]报错:xlrd.compdoc.CompDocError: Workbook: size exceeds expected 17920 bytes; corrupt?

    File "D:\Program Files\Python37\lib\site-packages\xlrd\__init__.py", line 157, in open_workbook ragged_rows =ragged_rows, File "D:\Program Files\Python37\lib\site-packages\xlrd\book.py", line 88, in open_workbook_xls ragged_rows=ragged_rows, File "D:\Program Files\Python37\lib\site-packages\xlrd\book.py", line

    1.3K30发布于 2020-09-17
  • 来自专栏计算机视觉理论及其实现

    Unicode strings

    返回的结果是tf.ragged张量,其中最内层维度的长度随每个字符串中的字符数而变化: # A batch of Unicode strings, each represented as a UTF8- batch_chars_ragged = tf.strings.unicode_decode(batch_utf8,                                                 input_encoding='UTF-8') for sentence_chars in batch_chars_ragged.to_list():   print(sentence_chars) [ /ragged_tensor.py:1553: add_dispatch_support. b'cow'], dtype=object)> 当编码多个长度可变的字符串时,使用tf.RaggedTensor作为输入: tf.strings.unicode_encode(batch_chars_ragged

    2.9K20编辑于 2022-09-30
  • 来自专栏有文化的技术人

    探索eventlet通信机制

    PROTOCOL_TLS, ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs server_side=server_side, do_handshake_on_connect=do_handshake_on_connect, suppress_ragged_eofs =suppress_ragged_eofs ) 可以看到该调用了SSLContext.wrap_socket方法,进入该方法: class SSLContext(_SSLContext): , server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs =suppress_ragged_eofs, server_hostname=server_hostname, context=self,

    82430编辑于 2022-10-27
  • 来自专栏AI科技大本营的专栏

    TensorFlow支持Unicode,中文NLP终于省心了

    batch_chars_ragged = tf.strings.unicode_decode(batch_utf8, input_encoding=' UTF-8') for sentence_chars in batch_chars_ragged.to_list(): print(sentence_chars) [104, 195, 108, 108 batch_chars_padded = batch_chars_ragged.to_tensor(default_value=-1) print(batch_chars_padded.numpy()) -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]] batch_chars_sparse = batch_chars_ragged.to_sparse b'cow'], dtype=object)> 编码多个不同长度的字符串时,应使用 tf.RaggedTensor 作为输入: tf.strings.unicode_encode(batch_chars_ragged

    4.6K20发布于 2018-12-28
  • 来自专栏新智元

    中文NLP的福音,TensorFlow支持Unicode了!(附教程)

    batch_chars_ragged = tf.strings.unicode_decode(batch_utf8, input_encoding=' UTF-8') for sentence_chars in batch_chars_ragged.to_list(): print(sentence_chars) [104, 195, 108, 108 batch_chars_padded = batch_chars_ragged.to_tensor(default_value=-1) print(batch_chars_padded.numpy()) -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]] batch_chars_sparse = batch_chars_ragged.to_sparse b'cow'], dtype=object)> 编码多个不同长度的字符串时,应使用 tf.RaggedTensor 作为输入: tf.strings.unicode_encode(batch_chars_ragged

    1.6K20发布于 2018-12-29
  • 来自专栏推荐算法学习

    Tensorflow2.0常用基础API

    # ragged tensorr = tf.ragged.constant([[11, 12], [21, 22, 23], [], [41]])# index opprint(r)print(r[1] )print(r[1:3])# ops on ragged tensorr2 = tf.ragged.constant([[51, 52], [], [71]])print(tf.concat([r, r2], axis = 0))# <tf.RaggedTensor [[11, 12], [21, 22, 23], [], [41], [51, 52], [], [71]]>r3 = tf.ragged.constant

    1.2K160编辑于 2023-06-26
  • 来自专栏云技术分享

    查看python中包的文档

    =0, use_mmap=1, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False, ragged_rows :param ragged_rows: The default of ``False`` means all rows are padded out with empty cells

    1.6K30发布于 2021-01-29
  • 来自专栏全栈测试技术

    Python读execl之xlrd库函数详解一:工作簿相关

    use_mmap=USE_MMAP, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False, ragged_rows

    65030编辑于 2023-01-17
  • 来自专栏计算机视觉理论及其实现

    tf.boolean_mask

    还请参见:tf.ragged.boolean_mask,它可以应用于稠密张量和不规则张量,如果需要保留张量的掩码维(而不是像tf.boolean_mask那样将它们压扁),可以使用它。

    2.7K20编辑于 2022-09-03
  • 来自专栏Hadoop数据仓库

    基于Hadoop生态圈的数据仓库实践 —— 进阶技术(八)

    下面是一个不完全促销期(在ragged_campaign.csv文件里)的例子,2016年1月、4月、6月、9月、10月、11月和12月没有促销期。 use rds; load data local inpath '/root/ragged_campaign.csv' overwrite into table campaign_session; use

    44730发布于 2019-05-25
  • 来自专栏AI

    [AI Stability] 开源AI新利器:Stable Diffusion 3 Medium震撼发布!文本到图像再升级!

    例子自己动手跑一下,看看效果prompt: happy-childrens-day提示词非常短,效果一般prompt: a-ragged-man-wearing-a-tattered-jacket-in-the-nineteenth-century

    60430编辑于 2024-06-13
  • Python自然语言处理的技术未来与架构演进

    Relu: Relu 层输出类型为 (thinc.types.Floats2d),但下一层期望输入为 (thinc.types.Ragged)。

    12310编辑于 2026-01-18
  • 来自专栏AI研习社

    微软携手亚马逊推出全新Gluon深度学习库,全面支持符号式和命令式编程

    执行高效 Gluon支持循环和不规则张量(ragged tensors)(能批处理变长度序列),对于RNN和LSTM模型具有空前的效率。

    96460发布于 2018-03-19
  • 来自专栏AI派

    开篇词 | 如何轻松玩转Pandas呢?

    通过DataFrame或者更高维的对象可以完成列的增加与删除 自动和显式地完成数据对齐 强大且灵活的group by功能可对数据集执行拆分应用组合操作,用于聚合和转换数据 轻松的将Python中的ragged

    93710发布于 2018-07-25
  • 来自专栏AI工程

    简化NLP:TensorFlow中tf.strings的使用

    tf.strings.to_hash_bucket_fast:词表映射(字典映射,单个字符到整形) tf.squeeze:用这个是因为我们的输入会产生一个额外的维度,我们需要去掉 tf.to_tensor:实际上我们之前的维度输入的是不定长的(ragged

    2.8K20发布于 2020-02-14
  • 来自专栏信数据得永生

    TensorFlow 2.0 快速入门指南:第一部分

    以下示例显示了如何声明一个常数的,参差不齐的数组以及各个切片的长度: ragged =tf.ragged.constant([[5, 2, 6, 1], [], [4, 10, 7], [8], [6,7 ]]) print(ragged) print(ragged[0,:]) print(ragged[1,:]) print(ragged[2,:]) print(ragged[3,:]) print( ragged[4,:]) 输出如下: <tf.RaggedTensor [[5, 2, 6, 1], [], [4, 10, 7], [8], [6, 7]]> tf.Tensor([5 2 6 1], values, row_splits, name=None ) 在这里,values是要变成参差不齐的数组的值的列表,row_splits是要拆分该值列表的位置的列表,因此行ragged [i]的值存储在其中 ragged.values[ragged.row_splits[i]:ragged.row_splits[i+1]]: print(tf.RaggedTensor.from_row_splits

    5.5K10编辑于 2023-04-23
  • 来自专栏Hadoop数据仓库

    维度模型数据仓库(十二) —— 多路径和参差不齐的层次

    下面是一个不完全推广期(在/root/data-integration/ragged_campaign.csv文件里)的例子,2014年1月、4月、9月、10月、11月和12月没有推广期。 COMMIT ; USE dw; TRUNCATE TABLE campaign_session_stg; LOAD DATA INFILE '/root/data-integration/ragged_campaign.csv

    62720编辑于 2022-12-02
  • 来自专栏Hadoop数据仓库

    HAWQ取代传统数仓实践(十八)——层次维度

    下面是一个不完全促销期的例子,数据存储在ragged_campaign.csv文件中。2017年1月、4月、6月、9月、10月、11月和12月没有促销期。 truncate table rds.campaign_session; copy rds.campaign_session from '/home/gpadmin/ragged_campaign.csv

    1.7K60发布于 2018-01-03
  • 来自专栏机器之心

    TensorFlow2.1正式版上线:最后一次支持Python2,进一步支持TPU

    修复当 sloppy=True 时 tf.data.experimental.parallel_interleave 出现的并发问题; 增加 tf.data.experimental.dense_to_ragged_batch

    1.4K30发布于 2020-02-12
领券