Keras: 基于 Python 的深度学习库安装指引 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.5 使用 TensorFlow 以外的后端 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.6 技术支持 . . . . . . . PYTHON 的深度学习库 1 1 Keras: 基于 Python 的深度学习库 1.1 你恰好发现了 Keras Keras 是一个用 Python 编写的高级神经网络 API,它能够以 TensorFlow, CNTK, 或者 Theano 作为后端运行。Keras 的开发重点是支持快速的实验。能够以最小的时延把你的想法转 换为实验结果,是做好研究的关键。 如果你在以下情况下需要深度学习库,请使用 的文本生成等等。 KERAS: 基于 PYTHON 的深度学习库 3 1.4 安装指引 在安装 Keras 之前,请安装以下后端引擎之一:TensorFlow,Theano,或者 CNTK。我们 推荐 TensorFlow 后端。 • TensorFlow 安装指引。 • Theano 安装指引。 • CNTK 安装指引。 你也可以考虑安装以下可选依赖: • cuDNN (如果你计划在0 码力 | 257 页 | 1.19 MB | 1 年前3
keras tutorial.......................................................................................... 9 TensorFlow .............................................................................................. such as Theano, TensorFlow, Caffe, Mxnet etc., Keras is one of the most powerful and easy to use python library, which is built on top of popular deep learning libraries like TensorFlow, Theano, etc., open source machine libraries like TensorFlow, Theano or Cognitive Toolkit (CNTK). Theano is a python library used for fast numerical computation tasks. TensorFlow is the most famous symbolic math library0 码力 | 98 页 | 1.57 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 2 - Compression Techniquesprocess of applying quantization in practical situations using popular frameworks like Tensorflow and Tensorflow Lite. An Overview of Compression One of the simplest approaches towards efficiency is Logistics We just wanted to take a moment to state that in this book, we have chosen to work with Tensorflow 2.0 (TF) because it has exhaustive support for building and deploying efficient models on devices PyTorch, Apple’s CoreML as well which are covered in chapter 10. If you are not familiar with the tensorflow framework, we refer you to the book Deep Learning with Python1. All the code examples in this book0 码力 | 33 页 | 1.96 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 3 - Learning Techniqueslearning frameworks provide quick ways to integrate these transformations during the training process. Tensorflow comes bundled with the ImageDataGenerator which can transform images during the training process apply our recent learnings and measure their impact. We will use the oxford_flowers102 dataset from tensorflow. It is a collection of 102 commonly occurring flowers in the UK (hence, the name). Instead of training The code for this project is available as a Jupyter notebook here. Tensorflow provides easy access to this dataset through the tensorflow-datasets package. Let’s start by loading the training and validation0 码力 | 56 页 | 18.93 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 6 - Advanced Learning Techniques - Technical ReviewIn this case BERT models have been downloaded tens of thousands of times just from the official Tensorflow Hub repository8. Similarly models like GPT-3, T5, etc. have the capability to be few-shot learners It excels in natural language generation and hence has been 8 BERT model on Tensorflow-Hub: https://tfhub.dev/tensorflow/bert_en_uncased_L-12_H-768_A-12/4 7 GPU pricing source: https://cloud.google GPT-3 API https://openai.com/api/ 9 GitHub Copilot: https://github.com/features/copilot import tensorflow_datasets as tfds with tf.device('/job:localhost'): ds = tfds.load('ag_news_subset', try_gcs=True0 码力 | 31 页 | 4.03 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 4 - Efficient Architecturescase here. Step 1: Vocabulary Creation In this step, we will use a TextVectorization layer from Tensorflow to create a vocabulary of the most relevant words. It finds the top N words in a dataset, sorts mean padding short texts with padding tokens and truncating the longer ones to 250 tokens. import tensorflow as tf # Size of our vocabulary. vocab_size = 5000 # This controls the max number of tokens the stop words like 'the', 'in', 'of', and so on. Step 2: Dataset Preparation and Vectorization The tensorflow vectorization_layer is a regular layer which can be invoked with a model as well as independently0 码力 | 53 页 | 3.92 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 7 - Automationeach one assigned to one of the five target classes. import random import tensorflow as tf import numpy as np from tensorflow.keras import layers, losses, optimizers X = tf.random.uniform((20, 5)) Y = and the dataset. import tensorflow as tf import tensorflow_datasets as tfds import keras_tuner as kt import numpy as np from matplotlib import pyplot as plt from tensorflow.keras import applications applications as apps from tensorflow.keras import layers, optimizers train_ds, val_ds, test_ds = tfds.load( 'oxford_flowers102', split=['train', 'validation', 'test'], as_supervised=True, read_config=tfds.ReadC0 码力 | 33 页 | 2.48 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 5 - Advanced Compression TechniquesJupyter notebook here. %%capture import gzip import operator, random import numpy as np import tensorflow as tf from functools import reduce from matplotlib import pyplot as plt We define two functions training. It clones the input model and wraps the prunable blocks for sparse training using TFMOT (Tensorflow Model Optimization) library. In this case, we prune the 50% of the weights in each prunable block shows the comparison of compressed sizes of our regular model and its 50% sparse version. We used Tensorflow's save_model() API and zipped the model files using gzip. In addition to the usual models, the0 码力 | 34 页 | 3.18 MB | 1 年前3
Leveraging the Power of C++ for Efficient Machine Learning on Embedded Deviceslayer can apply filters to detect: ◮ Edges ◮ Shapes ◮ Objects 14 / 50Software dependencies ◮ TensorFlow Lite ◮ OpenCV 16 / 50MobileNet pre-trained model ◮ CNN architecture created by Google ◮ Trained ◮ Memory consumption with 4 threads: 93MB 31 / 50Comparision with Python Comparision made with TensorFlow Lite’s label image.py C++ Python Running duration (s) 1 7 Number of threads Inference duration https://github.com/adrian-stanciu/cpp-embedded-ml 48 / 50Resources ◮ https://github.com/tensorflow/tensorflow/tree/ master/tensorflow/lite/examples/python ◮ https://kaggle.com/datasets/sanikamal/ rock-paper-scissors-dataset0 码力 | 51 页 | 1.78 MB | 6 月前3
Notes for install Keras on Anaconda3install Keras and Tensorflow for RStudio which works for most machines. However, if you have a PC which has a CPU purchased before 2012, the current versions(1.10-2.1) of Tensorflow could not be loaded loaded as AVX instructions set is needed from Tensorflow 1.6 and later. Please ensure your machine was purchased in 2012 or later. Step 1 Follow the document or video to install Anaconda3 and RStudio: this prompt: 1 conda install python=3.6 2 conda install -c conda-forge tensorflow 3 conda install -c r r-tensorflow 4 conda install -c conda-forge r-keras C) Open the RStudio and run the0 码力 | 3 页 | 654.13 KB | 8 月前3
共 62 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7













