tensorflow

NotFoundError: [_Derived_]No gradient defined for op: Einsum on Tensorflow 1.15.2

末鹿安然 提交于 2021-02-08 06:55:20
问题 I'm using Tensorflow 1.15.2 for making a WSD system, made with BERt in the Embeddings Layer. This is the code that I use for the model input_word_ids = tf.keras.layers.Input(shape=(64,), dtype=tf.int32, name="input_word_ids") input_mask = tf.keras.layers.Input(shape=(64,), dtype=tf.int32, name="input_mask") segment_ids = tf.keras.layers.Input(shape=(64,), dtype=tf.int32, name="segment_ids") # BERt = BERtLayer()([input_word_ids, input_mask, segment_ids]) bert = hub.KerasLayer("https://tfhub

Passing output of a CNN to BILSTM

旧巷老猫 提交于 2021-02-08 06:15:31
问题 I am working on a project in which I have to pass the output of CNN to Bi directional LSTM. I created the model as below but it is throwing 'incompatible' error. Please let me know where I am going wrong and how to fix this model = Sequential() model.add(Conv2D(filters = 16, kernel_size = 3,input_shape = (32,32,1))) model.add(BatchNormalization()) model.add(MaxPooling2D(pool_size=(2,2),strides=1, padding='valid')) model.add(Activation('relu')) model.add(Conv2D(filters = 32, kernel_size=3))

Keras the simplest NN model: error in training.py with indices

允我心安 提交于 2021-02-08 06:14:31
问题 I have read this example https://github.com/fchollet/keras/blob/master/examples/mnist_mlp.py and decide to use this idea to my base because this is the simplest NN for Keras. This is my base https://drive.google.com/file/d/0B-B3QUQOzGZ7WVhzQmRsOTB0eFE/view (you can download my csv file, it's only 83Kb ) This is picture my base: base.shape = (891, 23) import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout from keras.optimizers

Keras the simplest NN model: error in training.py with indices

大城市里の小女人 提交于 2021-02-08 06:14:29
问题 I have read this example https://github.com/fchollet/keras/blob/master/examples/mnist_mlp.py and decide to use this idea to my base because this is the simplest NN for Keras. This is my base https://drive.google.com/file/d/0B-B3QUQOzGZ7WVhzQmRsOTB0eFE/view (you can download my csv file, it's only 83Kb ) This is picture my base: base.shape = (891, 23) import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout from keras.optimizers

Tensorflow input pipeline where multiple rows correspond to a single observation?

社会主义新天地 提交于 2021-02-08 05:44:24
问题 So I've just started using Tensorflow, and I'm struggling to properly understand input pipelines. The problem I'm working on is sequence classification. I'm trying to read in a CSV file with shape (100000, 4). First 3 columns are features, 4th column is the label. BUT - the data represents sequences of length 10 i.e. rows 1-10 are sequence 1, rows 11-20 are sequence 2 etc. This also means each label is repeated 10 times. So at some point in this input pipeline, I'll need to reshape my feature

LSTM Batches vs Timesteps

天涯浪子 提交于 2021-02-08 05:41:46
问题 I've followed the TensorFlow RNN tutorial to create a LSTM model. However, in the process, I've grown confused as to the difference, if any, between 'batches' and 'timesteps', and I'd appreciate help in clarifying this matter. The tutorial code (see following) essentially creates 'batches' based on a designated number of steps: with tf.variable_scope("RNN"): for time_step in range(num_steps): if time_step > 0: tf.get_variable_scope().reuse_variables() (cell_output, state) = cell(inputs[:,

LSTM Batches vs Timesteps

限于喜欢 提交于 2021-02-08 05:41:06
问题 I've followed the TensorFlow RNN tutorial to create a LSTM model. However, in the process, I've grown confused as to the difference, if any, between 'batches' and 'timesteps', and I'd appreciate help in clarifying this matter. The tutorial code (see following) essentially creates 'batches' based on a designated number of steps: with tf.variable_scope("RNN"): for time_step in range(num_steps): if time_step > 0: tf.get_variable_scope().reuse_variables() (cell_output, state) = cell(inputs[:,

中阶API示范

╄→гoц情女王★ 提交于 2021-02-08 05:30:20
TensorFlow有5个不同的层次结构:即 硬件层 , 内核层 , 低阶API , 中阶API , 高阶API 。本章我们将以线性回归为例,直观对比展示在低阶API,中阶API,高阶API这三个层级实现模型的特点。 TensorFlow的层次结构从低到高可以分成如下五层。 最底层为硬件层,TensorFlow支持CPU、GPU或TPU加入计算资源池。 第二层为C++实现的内核,kernel可以跨平台分布运行。 第三层为Python实现的操作符,提供了封装C++内核的低级API指令,主要包括各种张量操作算子、计算图、自动微分. 如tf.Variable,tf.constant,tf.function,tf.GradientTape,tf.nn.softmax... 如果把模型比作一个房子,那么第三层API就是【模型之砖】。 第四层为Python实现的模型组件,对低级API进行了函数封装,主要包括各种模型层,损失函数,优化器,数据管道,特征列等等。 如tf.keras.layers,tf.keras.losses,tf.keras.metrics,tf.keras.optimizers,tf.data.Dataset,tf.feature_column... 如果把模型比作一个房子,那么第四层API就是【模型之墙】。 第五层为Python实现的模型成品

Faster Kmeans Clustering on High-dimensional Data with GPU Support

落爺英雄遲暮 提交于 2021-02-08 05:16:37
问题 We've been using Kmeans for clustering our logs. A typical dataset has 10 mill. samples with 100k+ features. To find the optimal k - we run multiple Kmeans in parallel and pick the one with the best silhouette score. In 90% of the cases we end up with k between 2 and 100. Currently, we are using scikit-learn Kmeans. For such a dataset, clustering takes around 24h on ec2 instance with 32 cores and 244 RAM. I've been currently researching for a faster solution. What I have already tested:

Faster Kmeans Clustering on High-dimensional Data with GPU Support

Deadly 提交于 2021-02-08 05:15:31
问题 We've been using Kmeans for clustering our logs. A typical dataset has 10 mill. samples with 100k+ features. To find the optimal k - we run multiple Kmeans in parallel and pick the one with the best silhouette score. In 90% of the cases we end up with k between 2 and 100. Currently, we are using scikit-learn Kmeans. For such a dataset, clustering takes around 24h on ec2 instance with 32 cores and 244 RAM. I've been currently researching for a faster solution. What I have already tested: