《Efficient Deep Learning Book》[EDL] Chapter 2 - Compression Techniquesthe original input can be discarded, based on the tolerance for loss in quality. The JPEG and MP3 formats are able to achieve a 10-11x compression without any perceptible loss in quality. However, further The tflite_model_eval() function starts by creating a tflite interpreter, which consumes the model file content. The model_content variable holds the contents of the model that we created earlier. Then of TFLiteConverter. A call to the convert() method on the converter object generates a tflite model file content string. We referred to this string as model_content earlier. The converter object also supports0 码力 | 33 页 | 1.96 MB | 1 年前3
机器学习课程-温州大学-numpy使用总结C语言中可以通过struct关键字定义结构类型。NumPy中也有类似的结构数组。 > persontype = np.dtype({ 'names':['name', 'age', 'weight'], 'formats':['S30','i', 'f']}) > a = np.array([("Zhang", 32, 75.5), ("Wang", 24, 65.2)], dtype=persontype)0 码力 | 49 页 | 1.52 MB | 1 年前3
动手学深度学习 v2.0os os.makedirs(os.path.join('..', 'data'), exist_ok=True) data_file = os.path.join('..', 'data', 'house_tiny.csv') with open(data_file, 'w') as f: f.write('NumRooms,Alley,Price\n') # 列名 f.write('NA 如果没有安装pandas,只需取消对以下行的注释来安装pandas # !pip install pandas import pandas as pd data = pd.read_csv(data_file) print(data) NumRooms Alley Price 0 NaN Pave 127500 1 2.0 NaN 106000 2 4.0 NaN 178100 3 NaN 微积分 65 def use_svg_display(): #@save """使用svg格式在Jupyter中显示绘图""" backend_inline.set_matplotlib_formats('svg') 我们定义set_figsize函数来设置图表大小。注意,这里可以直接使用d2l.plt,因为导入语句 from matplotlib import pyplot as plt已标记为保存到d2l包中。0 码力 | 797 页 | 29.45 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 5 - Advanced Compression TechniquesSavedModel format. import tempfile _, keras_file = tempfile.mkstemp('.h5') print('Saving model to: ', keras_file) tf.keras.models.save_model(model_wm_10, keras_file, include_optimizer=False) Saving model el) _, clustered_keras_file = tempfile.mkstemp('.h5') print('Saving clustered model to: ', clustered_keras_file) tf.keras.models.save_model(final_model, clustered_keras_file, include_optimizer=False) clustered_tflite_file = '/tmp/clustered_speech.tflite' converter = tf.lite.TFLiteConverter.from_keras_model(final_model) tflite_clustered_model = converter.convert() with open(clustered_tflite_file, 'wb') as0 码力 | 34 页 | 3.18 MB | 1 年前3
QCon北京2018-《从键盘输入到神经网络--深度学习在彭博的应用》-李碧野media/File:Moving_From_unknown_to_known_feature_spaces_based_on_TS-ELM_with_random_kernels_and_connections.tif https://commons.wikimedia.org/wiki/Category:Machine_learning_algorithms#/media/File:Movin nd_connections.tif https://commons.wikimedia.org/wiki/Category:Machine_learning_algorithms#/media/File:OPTICS.svg May be re-distributed in accordance with the terms of the CC-SA 4.0 license https://creativecommons L.P. All rights reserved. Computer Vision Tasks Modified from https://commons.wikimedia.org/wiki/File:Cats_Petunia_and_Mimosa_2004.jpg May be re-distributed in accordance with the terms of the CC-SA 40 码力 | 64 页 | 13.45 MB | 1 年前3
AI大模型千问 qwen 中文文档huggingface-cli(首先需要通过命令 pip install huggingface_hub 安装它): huggingface-cli downloadfile> --local-dir --local-dir- �→use-symlinks False 比如: huggingface-cli download Qwen/Qwen1 slightly bad static_groups=False, sym=True, true_sequential=True, model_name_or_path=None, model_file_base_name="model" ) max_len = 8192 # Load your tokenizer and model with AutoGPTQ # To learn about modules for LoRA. By default we tune all linear layers; • lora_weight_path: the path to the weight file for LoRA; • lora_bias: the bias for LoRA; • q_lora: whether to use Q-LoRA. def maybe_zero_3(param): 0 码力 | 56 页 | 835.78 KB | 1 年前3
Keras: 基于 Python 的深度学习库normalize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 20.6 get_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 20.7 print_summary io_utils 中的 HDF5Matrix 类。有关详细信息,请参阅 HDF5Matrix 文档。 你也可以直接使用 HDF5 数据集: import h5py with h5py.File('input/file.hdf5', 'r') as f: x_data = f['x_data'] model.predict(x_data) 快速开始 36 3.3.19 Keras 配置文件保存在哪里? 用于防止在某些操作中被零除的 epsilon 模糊因子。 • 默认浮点数据类型。 • 默认后端。详见 backend 文档。 同 样, 缓 存 的 数 据 集 文 件 (如 使 用 get_file() 下 载 的 文 件) 默 认 存 储 在 $HOME/.keras/datasets/ 中。 3.3.20 如何在 Keras 开发过程中获取可复现的结果? 在模型的开发过程中,能够在0 码力 | 257 页 | 1.19 MB | 1 年前3
keras tutorialthe below command: pip install TensorFlow Once we execute keras, we could see the configuration file is located at your home directory inside and go to .keras/keras.json. keras.json { "image_data_format": or float64 using set_floatx() method. backend denotes the current backend. Suppose, if the file is not created then move to the location and create using the below steps: > cd home > mkdir Remember, you should specify .keras as its folder name and add the above configuration inside keras.json file. We can perform some pre-defined operations to know backend functions. 3. Keras ― Backend Configuration0 码力 | 98 页 | 1.57 MB | 1 年前3
Machine Learning Pytorch TutorialPrerequisites ● We assume you are already familiar with… 1. Python3 ■ if-else, loop, function, file IO, class, ... ■ refs: link1, link2, link3 2. Deep Learning Basics ■ Prof. Lee’s 1st & 2nd lecture expected values ● Dataloader: groups data in batches, enables multiprocessing ● dataset = MyDataset(file) ● dataloader = DataLoader(dataset, batch_size, shuffle=True) More info about batches and shuffling from torch.utils.data import Dataset, DataLoader class MyDataset(Dataset): def __init__(self, file): self.data = ... def __getitem__(self, index): return self.data[index] def0 码力 | 48 页 | 584.86 KB | 1 年前3
【PyTorch深度学习-龙龙老师】-测试版2021122 + ?3?3 + ⋯ + ???? + ? 上述计算逻辑可以通过图 2.2(b)直观地展现。 ① 素材来自 https://commons.wikimedia.org/wiki/File:Neuron_Hand-tuned.svg 预览版202112 第 2 章 回归问题 2 ?1 ?2 ?3 ?? ?? ? ? ?1 tensorflow import keras import pandas as pd # 在线下载汽车效能数据集 dataset_path = keras.utils.get_file("auto-mpg.data", "http://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto- mpg.data") 可以通过如下可视化代码绘制数据集的分布,如图 7.14 所示。 # 绘制数据集的分布,X 为 2D 坐标,y 为数据点的标签 def make_plot(X, y, plot_name, file_name=None, XX=None, YY=None, preds=None, dark=False): if (dark): plt.style.use('dark_background')0 码力 | 439 页 | 29.91 MB | 1 年前3
共 20 条
- 1
- 2













