-
大小: 3.24KB文件类型: .py金币: 1下载: 0 次发布日期: 2021-03-03
- 语言: Python
- 标签: tensorflow and xor
资源简介
在tensorflow中实现的and和xor函数的例子
代码片段和文件信息
#!/usr/bin/env python
import tensorflow as tf
import math
import numpy as np
INPUT_COUNT = 2
OUTPUT_COUNT = 2
HIDDEN_COUNT = 2
LEARNING_RATE = 0.1
MAX_STEPS = 5000
# For every training loop we are going to provide the same input and expected output data
INPUT_TRAIN = np.array([[0 0] [0 1] [1 0] [1 1]])
OUTPUT_TRAIN = np.array([[1 0] [0 1] [0 1] [1 0]])
# Nodes are created in Tensorflow using placeholders. Placeholders are values that we will input when we ask Tensorflow to run a computation.
# Create inputs x consisting of a 2d tensor of floating point numbers
inputs_placeholder = tf.placeholder(“float“
shape=[None INPUT_COUNT])
labels_placeholder = tf.placeholder(“float“
shape=[None OUTPUT_COUNT])
# We need to create a python dictionary object with placeholders as keys and feed tensors as values
feed_dict = {
inputs_placeholder: INPUT_TRAIN
labels_placeholder: OUTPUT_TRAIN
}
# Define weights and biases from input layer to hidden l
相关资源
- word2vec.py(来自黄文坚的“tensorflow实
- python多渠道打包android App(资料+源码
- santander-product-recommendation方案1
- python随机生成学生信息并写入文件(
- keras+tensorflow CNN
- Developing MeeGo apps with Python and QML
- Learn Python in One Day and Learn It Well Pyth
- python 画的一棵树(基于turtle+math+ran
- 基于机器学习框架tensorflow的图像分类
- 机器学习实战:基于 Scikit-Learn 和 T
- 《白话深度学习与TensorFlow》.pdf
- Tensorflow+实战Google深度学习框架
- android 多渠道打包(python)
- python MNIST分类 tensorflow
- tensorflow下用LSTM网络进行时间序列预测
- 深度学习之二:用Tensorflow实现卷积神
- tensorflow版本的YOLO v3,在Windows系统下
- Python实现的TensorFlow入门案例
- 《TensorFlow技术解析与实战》高清中文
- python实现TensorFlow2 股票股价预测(源
- 计算 语义分割结果 MIOU,miou.py操作简
- tensorflow做cifar-10识别
- TensorFlow手写数字识别代码
- 基于前推回代法的潮流计算python实现
- 基于kNN方法的MNIST手写数字识别Tenso
- cifar10_input.py
- Python-PythonTensorflowKeras实现参数tSNE算法
- TensorFlow实现CNN
- 介数中心性算法实现
- Python TensorFlow手写数字识别
评论
共有 条评论