Keras: 基于 Python 的深度学习库preprocessing.sequence.TimeseriesGenerator(data, targets, length,sampling_rate=1, stride=1, start_index=0, end_index=None, shuffle=False, reverse=False, batch_size=128) 用于生成批量时序数据的实用工具类。 这个类以一系列由相等间隔以及一些时 data[i+s], data[i+2*s] 等。 • start_index: 在 start_index 之前的数据点在输出序列中将不被使用。这对保留部分数据 以进行测试或验证很有用。 • end_index: 在 end_index 之后的数据点在输出序列中将不被使用。这对保留部分数据以进 行测试或验证很有用。 • shuffle: 是否打乱输出样本,还是按照时间顺序绘制它们。 • reverse: logs 里面包含以下的数 据: • on_epoch_end: 包括 acc 和 loss 的日志,也可以选择性的包括 val_loss(如果在 fit 中 启用验证),和 val_acc(如果启用验证和监测精确值)。 • on_batch_begin: 包括 size 的日志,在当前批量内的样本数量。 • on_batch_end: 包括 loss 的日志,也可以选择性的包括 acc(如果启用监测精确值)。0 码力 | 257 页 | 1.19 MB | 1 年前3
PyTorch Release Notessuch as PyTorch. PyTorch is a GPU-accelerated tensor computational framework with a Python front end. Functionality can be easily extended with common Python libraries such as NumPy, SciPy, and Cython implementation of the Jasper model in PyTorch from the Jasper: An End-to-End Convolutional Neural Acoustic Model paper. The Jasper model is an end-to-end neural acoustic model for automatic speech recognition (ASR) (ASR) that provides near state-of-the-art results on LibriSpeech among end-to-end ASR models without external data. This model script is available on GitHub and NGC. ‣ BERT model: Bidirectional Encoder0 码力 | 365 页 | 2.94 MB | 1 年前3
机器学习课程-温州大学-时间序列总结象。 date_range(start = None, end = None, periods = None, freq = None, tz = None, normalize = False, name = None, closed = None,** kwargs) ➢ start:表示起始日期,默认为None。 ➢ end:表示终止日期,默认为None。 ➢ periods:表示产生多少个时间戳索引值。 freq:用来指定计时单位。 20 创建固定频率的时间序列 start、end、periods、freq这四个参数 至少要指定三个参数,否则会出现错误。 21 创建固定频率的时间序列 当调用date_range()函数创建DatetimeIndex对 象时,如果只是传入了开始日期(start参数)与 结束日期(end参数),则默认生成的时间戳是 按天计算的,即freq参数为D。 pd.d 如果只是传入了开始日期或结束日期,则还 需要用periods参数指定产生多少个时间戳。 pd.date_range(start='2018/08/10', periods=5) pd.date_range(end='2018/08/10', periods=5) 23 创建固定频率的时间序列 如果希望时间序列中的时间戳都是每周固定 的星期日,则可以在创建DatetimeIndex时 将freq参数设为“W-SUN”。0 码力 | 67 页 | 1.30 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 4 - Efficient Architecturesvocabulary. Our string of interest is ‘efficient deep learning’, but we will add a random token at the end that we are confident will not be in the vocabulary. edl_sequence_output = vectorization_layer( [['efficient table. We keep this layer trainable to learn the embedding table as we train the model. Towards the end, we will compare the qualities of the models trained with these two styles of embedding layers. def 96.42% v/s a top accuracy of 95.51% when not using pre-trained embeddings. Step 5: Exporting an end-to-end model. Ideally, we would prefer the model to accept string inputs (instead of a sequence of integers)0 码力 | 53 页 | 3.92 MB | 1 年前3
【PyTorch深度学习-龙龙老师】-测试版202112在循环计算或者对张量进行索引时,经常需要创建一段连续的整型序列,可以通过 torch.arange()函数实现。torch.arange(start, end, step)可以创建[start, end)之间,步长为 step 的整型序列,不包含 end 本身。例如,创建 0~10,步长为 1 的整型序列: In [38]: torch.arange(10) # 0~10,不包含 10 Out[38]: 1~10,步长为 2 的整形向量 Out[39]: tensor([1, 3, 5, 7, 9]) 需要注意的是,torch.range(start,end,step)函数是创建[start, limit],步长为 step 的序 列,但包含 end 本身。例如: In [40]: torch.range(2,10,step=2) # 1~10,步长为 2 Out[40]: tensor([ tensor([ 1.7487534 , -0.41491988, -0.2944692 ]) 4.6.2 切片 通过start:end: step切片方式可以方便地提取一段数据,其中 start 为开始读取位置的索 引,end 为结束读取位置的索引(不包含 end 位),step 为采样步长。 预览版202112 第 4 章 PyTorch 基础 18 以 shape 为[40 码力 | 439 页 | 29.91 MB | 1 年前3
AI大模型千问 qwen 中文文档TEMPLATE """{{ if and .First .System }}<|im_start|>system {{ .System }}<|im_end|> {{ end }}<|im_start|>user {{ .Prompt }}<|im_end|> <|im_start|>assistant {{ .Response }}""" # set the system message (续下页) PromptTemplate def completion_to_prompt(completion): return f"<|im_start|>system\n<|im_end|>\n<|im_start|>user\n{completion}<|im_end|>\n �→<|im_start|>assistant\n" def messages_to_prompt(messages): prompt = "" prompt += f"<|im_start|>system\n{message.content}<|im_end|>\n" elif message.role == "user": prompt += f"<|im_start|>user\n{message.content}<|im_end|>\n" elif message.role == "assistant": prompt += f"0 码力 | 56 页 | 835.78 KB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 6 - Advanced Learning Techniques - Technical Reviewthat the model learns general representations of the inputs. Pre-training is data-efficient since we end up saving on the number of labels required to achieve the desired model quality on our task. 2. Fine-tuning: the GitHub’s Copilot software9 where GPT-3 is used for auto-completing code snippets with an IDE. End-users can also use GPT-3 API10 to build their own applications. Given the large number of possible output = bert_encoder(bert_inputs)['pooled_output'] # Add a few dense layers + non-linearities in the end as a projection head output = tf.keras.layers.Dense(200, activation='relu')(output) output = tf.keras0 码力 | 31 页 | 4.03 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 5 - Advanced Compression Techniquesfollowed by removing the smallest number of weights, and fine-tuning the network in each round. At the end of rounds, weights will have been removed. Now that we have presented a general algorithm for pruning onwards. The model variable refers to the pet segmentation model from chapter four. # Pruning start and end blocks prunable_blocks = list(map(lambda l: l.name, model.layers[2:13])) model_for_pruning = cre initial set of centroids. 2. Assignment step: Assign each element in to the closest centroid. At the end of this step, there should be clusters. 3. Update step: Compute the new centroids by computing the0 码力 | 34 页 | 3.18 MB | 1 年前3
深度学习下的图像视频处理技术-沈小勇Time 69 / frame Scale Factor: 4× Frames: 3 0.14 s More Results 70 71 72 Summary 73 • End-to-end & fully scalable • New SPMC layer • High-quality & fast speed ???????????????????????? ?????? 111 Ours More Results 112 113 Input 114 Ours 115 Input 116 Ours 117 Input 118 Ours A new end-to-end CNN-based framework for deblurring. Without assumptions on blur models. Visually and quantitatively0 码力 | 121 页 | 37.75 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 1 - IntroductionSeinfeld. While there is no way of predicting with absolute certainty the exact content that you would end up clicking on, at that particular moment, with more data and sophisticated algorithms, these models techniques that can help us make models pareto-optimal and let the user pick the right tradeoff. To that end, we can think of work on efficient deep learning to be categorized in roughly four core areas, with just learning hyper-parameters, and instead search for efficient architectures (layers, blocks, end-to-end models) automatically. A simplistic architecture search could involve just learning the number0 码力 | 21 页 | 3.17 MB | 1 年前3
共 26 条
- 1
- 2
- 3













