Keras - 用于文本分析的自动编码器

2023-12-09

因此,我正在尝试创建一个自动编码器,它将接受文本评论并找到较低维度的表示。我正在使用 keras,我希望我的损失函数能够将 AE 的输出与嵌入层的输出进行比较。不幸的是,它给了我以下错误。我很确定问题出在我的损失函数上,但我似乎无法解决这个问题。

自动编码器

print X_train.shape
input_i = Input(shape=(200,))
embedding = Embedding(input_dim=weights.shape[0],output_dim=weights.shape[1],
                      weights=[weights])(input_i)
encoded_h1 = Dense(64, activation='tanh')(embedding)
encoded_h2 = Dense(32, activation='tanh')(encoded_h1)
encoded_h3 = Dense(16, activation='tanh')(encoded_h2)
encoded_h4 = Dense(8, activation='tanh')(encoded_h3)
encoded_h5 = Dense(4, activation='tanh')(encoded_h4)
latent = Dense(2, activation='tanh')(encoded_h5)
decoder_h1 = Dense(4, activation='tanh')(latent)
decoder_h2 = Dense(8, activation='tanh')(decoder_h1)
decoder_h3 = Dense(16, activation='tanh')(decoder_h2)
decoder_h4 = Dense(32, activation='tanh')(decoder_h3)
decoder_h5 = Dense(64, activation='tanh')(decoder_h4)

output = Dense(weights.shape[1], activation='tanh')(decoder_h5)

autoencoder = Model(input_i,output)
encoder = Model(input_i,latent)

print autoencoder.summary()

import keras.backend as K
import tensorflow as tf
def embedded_mse(x_true, e_pred):
    print output
    print embedding
    mse = K.mean(K.square(output - embedding))
    print mse

    return tf.Session().run(mse)
autoencoder.compile(optimizer='adadelta',
                    loss=embedded_mse)
autoencoder.fit(X_train,X_train,epochs=10,
                batch_size=256, validation_split=.1)

Output

(100000, 200)
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
input_47 (InputLayer)        (None, 200)               0         
_________________________________________________________________
embedding_31 (Embedding)     (None, 200, 100)          21833700  
_________________________________________________________________
dense_528 (Dense)            (None, 200, 64)           6464      
_________________________________________________________________
dense_529 (Dense)            (None, 200, 32)           2080      
_________________________________________________________________
dense_530 (Dense)            (None, 200, 16)           528       
_________________________________________________________________
dense_531 (Dense)            (None, 200, 8)            136       
_________________________________________________________________
dense_532 (Dense)            (None, 200, 4)            36        
_________________________________________________________________
dense_533 (Dense)            (None, 200, 2)            10        
_________________________________________________________________
dense_534 (Dense)            (None, 200, 4)            12        
_________________________________________________________________
dense_535 (Dense)            (None, 200, 8)            40        
_________________________________________________________________
dense_536 (Dense)            (None, 200, 16)           144       
_________________________________________________________________
dense_537 (Dense)            (None, 200, 32)           544       
_________________________________________________________________
dense_538 (Dense)            (None, 200, 64)           2112      
_________________________________________________________________
dense_539 (Dense)            (None, 200, 100)          6500      
=================================================================
Total params: 21,852,306
Trainable params: 21,852,306
Non-trainable params: 0
_________________________________________________________________
None
Tensor("dense_539/Tanh:0", shape=(?, 200, 100), dtype=float32)
Tensor("embedding_31/Gather:0", shape=(?, 200, 100), dtype=float32)
Tensor("loss_48/dense_539_loss/Mean:0", shape=(), dtype=float32)

Error

---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
<ipython-input-155-a18e0c32f59b> in <module>()
      1 autoencoder.compile(optimizer='adadelta',
----> 2                     loss=embedded_mse)
      3 autoencoder.fit(X_train,embedding,epochs=10,
      4                 batch_size=256, validation_split=.1)

/home/andrew/.local/lib/python2.7/site-packages/keras/engine/training.pyc in compile(self, optimizer, loss, metrics, loss_weights, sample_weight_mode, weighted_metrics, target_tensors, **kwargs)
    848                 with K.name_scope(self.output_names[i] + '_loss'):
    849                     output_loss = weighted_loss(y_true, y_pred,
--> 850                                                 sample_weight, mask)
    851                 if len(self.outputs) > 1:
    852                     self.metrics_tensors.append(output_loss)

/home/andrew/.local/lib/python2.7/site-packages/keras/engine/training.pyc in weighted(y_true, y_pred, weights, mask)
    448         """
    449         # score_array has ndim >= 2
--> 450         score_array = fn(y_true, y_pred)
    451         if mask is not None:
    452             # Cast the mask to floatX to avoid float64 upcasting in theano

<ipython-input-153-73211fc383a5> in embedded_mse(x_true, e_pred)
      7     print mse
      8 
----> 9     return tf.Session().run(mse)

/home/andrew/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata)
    893     try:
    894       result = self._run(None, fetches, feed_dict, options_ptr,
--> 895                          run_metadata_ptr)
    896       if run_metadata:
    897         proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

/home/andrew/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata)
   1122     if final_fetches or final_targets or (handle and feed_dict_tensor):
   1123       results = self._do_run(handle, final_targets, final_fetches,
-> 1124                              feed_dict_tensor, options, run_metadata)
   1125     else:
   1126       results = []

/home/andrew/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
   1319     if handle is None:
   1320       return self._do_call(_run_fn, self._session, feeds, fetches, targets,
-> 1321                            options, run_metadata)
   1322     else:
   1323       return self._do_call(_prun_fn, self._session, handle, feeds, fetches)

/home/andrew/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _do_call(self, fn, *args)
   1338         except KeyError:
   1339           pass
-> 1340       raise type(e)(node_def, op, message)
   1341 
   1342   def _extend_graph(self):

InvalidArgumentError: You must feed a value for placeholder tensor 'input_47' with dtype float and shape [?,200]
     [[Node: input_47 = Placeholder[dtype=DT_FLOAT, shape=[?,200], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

Caused by op u'input_47', defined at:
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andrew/.local/lib/python2.7/site-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/home/andrew/.local/lib/python2.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/home/andrew/.local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 477, in start
    ioloop.IOLoop.instance().start()
  File "/home/andrew/.local/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 177, in start
    super(ZMQIOLoop, self).start()
  File "/home/andrew/.local/lib/python2.7/site-packages/tornado/ioloop.py", line 888, in start
    handler_func(fd_obj, events)
  File "/home/andrew/.local/lib/python2.7/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/andrew/.local/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 440, in _handle_events
    self._handle_recv()
  File "/home/andrew/.local/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 472, in _handle_recv
    self._run_callback(callback, msg)
  File "/home/andrew/.local/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 414, in _run_callback
    callback(*args, **kwargs)
  File "/home/andrew/.local/lib/python2.7/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/andrew/.local/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/andrew/.local/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 235, in dispatch_shell
    handler(stream, idents, msg)
  File "/home/andrew/.local/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 399, in execute_request
    user_expressions, allow_stdin)
  File "/home/andrew/.local/lib/python2.7/site-packages/ipykernel/ipkernel.py", line 196, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
  File "/home/andrew/.local/lib/python2.7/site-packages/ipykernel/zmqshell.py", line 533, in run_cell
    return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
  File "/home/andrew/.local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2718, in run_cell
    interactivity=interactivity, compiler=compiler, result=result)
  File "/home/andrew/.local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2822, in run_ast_nodes
    if self.run_code(code, result):
  File "/home/andrew/.local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2882, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-152-7732fda181fc>", line 2, in <module>
    input_i = Input(shape=(200,))
  File "/home/andrew/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 1436, in Input
    input_tensor=tensor)
  File "/home/andrew/.local/lib/python2.7/site-packages/keras/legacy/interfaces.py", line 87, in wrapper
    return func(*args, **kwargs)
  File "/home/andrew/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 1347, in __init__
    name=self.name)
  File "/home/andrew/.local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 442, in placeholder
    x = tf.placeholder(dtype, shape=shape, name=name)
  File "/home/andrew/.local/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1548, in placeholder
    return gen_array_ops._placeholder(dtype=dtype, shape=shape, name=name)
  File "/home/andrew/.local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 2094, in _placeholder
    name=name)
  File "/home/andrew/.local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
    op_def=op_def)
  File "/home/andrew/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2630, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "/home/andrew/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1204, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'input_47' with dtype float and shape [?,200]
     [[Node: input_47 = Placeholder[dtype=DT_FLOAT, shape=[?,200], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

您的问题存在一些问题(例如,什么是weights,用在Embedding& 最终的Dense层参数?)。尽管如此,我认为更简单的方法是首先构建一个简单的嵌入模型,然后使用其输出(与predict)来喂养你的自动编码器。这样你就不必定义自定义损失(顺便说一句,print此类函数中的语句不是一个好主意)。

在不知道数据详细信息的情况下,以下 2 个模型可以编译正常:

嵌入模型(快速适应docs)

model = Sequential()
model.add(Embedding(1000, 64))
model.compile('rmsprop', 'mse')

自动编码器:

input_i = Input(shape=(200,100))
encoded_h1 = Dense(64, activation='tanh')(input_i)
encoded_h2 = Dense(32, activation='tanh')(encoded_h1)
encoded_h3 = Dense(16, activation='tanh')(encoded_h2)
encoded_h4 = Dense(8, activation='tanh')(encoded_h3)
encoded_h5 = Dense(4, activation='tanh')(encoded_h4)
latent = Dense(2, activation='tanh')(encoded_h5)
decoder_h1 = Dense(4, activation='tanh')(latent)
decoder_h2 = Dense(8, activation='tanh')(decoder_h1)
decoder_h3 = Dense(16, activation='tanh')(decoder_h2)
decoder_h4 = Dense(32, activation='tanh')(decoder_h3)
decoder_h5 = Dense(64, activation='tanh')(decoder_h4)

output = Dense(100, activation='tanh')(decoder_h5)

autoencoder = Model(input_i,output)

autoencoder.compile('adadelta','mse')

根据您的情况调整上述模型参数后,应该可以正常工作:

X_embedded = model.predict(X_train)
autoencoder.fit(X_embedded,X_embedded,epochs=10,
            batch_size=256, validation_split=.1)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Keras - 用于文本分析的自动编码器 的相关文章

  • 我怎样才能更多地了解Python的内部原理? [关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 我使用Python编程已经有半年多了 我对Python内部更感兴趣 而不是使用Python开发应用程序
  • 如何迭代按值排序的 Python 字典?

    我有一本字典 比如 a 6 b 1 c 2 我想迭代一下by value 不是通过键 换句话说 b 1 c 2 a 6 最直接的方法是什么 sorted dictionary items key lambda x x 1 对于那些讨厌 la
  • 从 ffmpeg 获取实时输出以在进度条中使用(PyQt4,stdout)

    我已经查看了很多问题 但仍然无法完全弄清楚 我正在使用 PyQt 并且希望能够运行ffmpeg i file mp4 file avi并获取流式输出 以便我可以创建进度条 我看过这些问题 ffmpeg可以显示进度条吗 https stack
  • 如何使用 imaplib 获取“消息 ID”

    我尝试获取一个在操作期间不会更改的唯一 ID 我觉得UID不好 所以我认为 Message ID 是正确的 但我不知道如何获取它 我只知道 imap fetch uid XXXX 有人有解决方案吗 来自 IMAP 文档本身 IMAP4消息号
  • 在 Python distutils 中从 setup.py 查找脚本目录的正确方法?

    我正在分发一个具有以下结构的包 mymodule mymodule init py mymodule code py scripts script1 py scripts script2 py The mymodule的子目录mymodul
  • Pandas 数据帧到 numpy 数组 [重复]

    这个问题在这里已经有答案了 我对 Python 很陌生 经验也很少 我已经设法通过复制 粘贴和替换我拥有的数据来使一些代码正常工作 但是我一直在寻找如何从数据框中选择数据 但无法理解这些示例并替换我自己的数据 总体目标 如果有人真的可以帮助
  • 使用 Python pandas 计算调整后的成本基础(股票买入/卖出的投资组合分析)

    我正在尝试对我的交易进行投资组合分析 并尝试计算调整后的成本基础价格 我几乎尝试了一切 但似乎没有任何效果 我能够计算调整后的数量 但无法获得调整后的购买价格有人可以帮忙吗 这是示例交易日志原始数据 import pandas as pd
  • 对图像块进行多重处理

    我有一个函数必须循环遍历图像的各个像素并计算一些几何形状 此函数需要很长时间才能运行 在 24 兆像素图像上大约需要 5 小时 但似乎应该很容易在多个内核上并行运行 然而 我一生都找不到一个有据可查 解释充分的例子来使用 Multiproc
  • TensorFlow的./configure在哪里以及如何启用GPU支持?

    在我的 Ubuntu 上安装 TensorFlow 时 我想将 GPU 与 CUDA 结合使用 但我却停在了这一步官方教程 http www tensorflow org get started os setup md 这到底是哪里 con
  • 从 python 发起 SSH 隧道时出现问题

    目标是在卫星服务器和集中式注册数据库之间建立 n 个 ssh 隧道 我已经在我的服务器之间设置了公钥身份验证 因此它们只需直接登录而无需密码提示 怎么办 我试过帕拉米科 它看起来不错 但仅仅建立一个基本的隧道就变得相当复杂 尽管代码示例将受
  • Numpy 过滤器平滑零区域

    我有一个 0 及更大整数的 2D numpy 数组 其中值代表区域标签 例如 array 9 9 9 0 0 0 0 1 1 1 9 9 9 9 0 7 1 1 1 1 9 9 9 9 0 2 2 1 1 1 9 9 9 8 0 2 2 1
  • 奇怪的 MySQL Python mod_wsgi 无法连接到 'localhost' (49) 上的 MySQL 服务器问题

    StackOverflow上也有类似的问题 但我还没有发现完全相同的情况 这是在使用 MySQL 的 OS X Leopard 机器上 一些起始信息 MySQL Server version 5 1 30 Apache 2 2 13 Uni
  • 首先对列表中最长的项目进行排序

    我正在使用 lambda 来修改排序的行为 sorted list key lambda item item lower len item 对包含元素的列表进行排序A1 A2 A3 A B1 B2 B3 B 结果是A A1 A2 A3 B
  • 在 pytube3 中获取 youtube 视频的标题?

    我正在尝试构建一个应用程序来使用 python 下载 YouTube 视频pytube3 但我无法检索视频的标题 这是我的代码 from pytube import YouTube yt YouTube link print yt titl
  • 在 Pandas 中使用正则表达式的多种模式

    我是Python编程的初学者 我正在探索正则表达式 我正在尝试从 描述 列中提取一个单词 数据库名称 我无法给出多个正则表达式模式 请参阅下面的描述和代码 描述 Summary AD1 Low free DATA space in data
  • 使用 Firefox 绕过弹出窗口下载文件:Selenium Python

    我正在使用 selenium 和 python 来从中下载某些文件web page http www oceanenergyireland com testfacility corkharbour observations 我之前一直使用设
  • 使用yield 进行字典理解

    作为一个人为的例子 myset set a b c d mydict item yield join item s for item in myset and list mydict gives as cs bs ds a None b N
  • 使用 PyTorch 分布式 NCCL 连接失败

    我正在尝试使用 torch distributed 将 PyTorch 张量从一台机器发送到另一台机器 dist init process group 函数正常工作 但是 dist broadcast 函数中出现连接失败 这是我在节点 0
  • 检查字典键是否有空值

    我有以下字典 dict1 city name yass region zipcode phone address tehsil planet mars 我正在尝试创建一个基于 dict1 的新字典 但是 它不会包含带有空字符串的键 它不会包
  • Scrapy Spider不存储状态(持久状态)

    您好 有一个基本的蜘蛛 可以运行以获取给定域上的所有链接 我想确保它保持其状态 以便它可以从离开的位置恢复 我已按照给定的网址进行操作http doc scrapy org en latest topics jobs html http d

随机推荐

  • 我需要一个正则表达式将美国电话号码转换为链接

    基本上 输入字段只是一个字符串 人们以各种格式输入电话号码 我需要一个正则表达式来查找这些数字并将其转换为链接 输入示例 201 555 1212 201 555 1212 201 555 1212 555 1212 这就是我想要的 a h
  • socket.error: [Errno 48] 地址已在使用中

    我正在尝试从 mac 终端使用 python 设置服务器 我导航到文件夹位置并使用 python m SimpleHTTPServer 但这给了我错误 socket error Errno 48 Address already in use
  • 使用 Gspread 在文件夹中创建电子表格

    我无法找到有关如何使用 Gspread 在某个 Google Drive 目录中创建 GSheet 的任何文档 我检查了文档并查看了一些后端代码 我目前正在使用下面的代码来创建电子表格 worksheet sh add worksheet
  • 如何将Asterisk服务器与外部关系数据库(例如mysql)集成?

    我的目标 客户端 SIP电话 我使用3CX电话 拨号到asterisk服务器 asterisk然后连接外部关系数据库 与asterisk服务器不在同一位置 如果数据库响应某些内容 asterisk服务器播放语音文件 预定义的 gsm 文件
  • 传递 URL 中包含“%”的参数?

    例如 在传递我的网址时something 8000 something jsp param1 update param2 1000 param3 SearchString param4 3 我收到以下错误 Bad Request Your
  • 将每个组中的行替换为第一行值。熊猫集团

    这是一个数据框 df pd DataFrame A foo foo bar bar bar B 1 2 2 4 1 下面是我想要的样子 这就是我的尝试和失败的方法 groups df groupby A groups apply lambd
  • 使用 jQuery 滚动到某个元素

    我有这个input元素
  • 如何从 C++ 更改 Windows shell (cmd.exe) 环境变量?

    我想编写一个程序 在调用它的 shell cmd exe 实例中设置环境变量 我的想法是 我可以在这个变量中存储一些状态 然后在后续调用中再次使用它 我知道有像 SetEnvironmentVariable 这样的命令 但我的理解是这些命令
  • 在 msi 自定义操作中执行时,MsiOpenDatabaseW 引发访问冲突

    我有一个代码可以修改cached 不是正在安装的 msi 安装程序数据库工作正常在独立 exe 中执行时 但是当它从 msi 自定义操作中运行时 我遇到了非常奇怪的访问冲突 const auto msiProductCode GetProd
  • 为迷宫墙添加碰撞

    有人可以帮我向我的精灵添加碰撞点吗 我过去有一个代码 我在图像上分层了位图 但相同的代码不能很好地集成用于物理绘制线条 而不是检测图像上黑色 灰色的位置 import random import pygame pygame init WHI
  • ExtractAssociatedIcon 返回 null

    我正在使用ExtractAssociatedIcon检索文件图标的方法 我的希望是检索用户在资源管理器窗口中看到的相同图标 public static Icon GetIcon string fileName try Icon icon I
  • 导入错误:没有名为“请求”的模块

    尝试运行 Python 脚本时出现此错误 我已经下载了 requests 1 2 0 文件夹 但我不知道如何处理它 我尝试运行下载中包含的 setup py 文件 但它只是打开命令终端一秒钟然后关闭 我从 Windows 桌面运行 Pyth
  • 网格中不相交路径的近似算法

    我最近遇到了这个问题 我想我可以在这里分享它 因为我无法得到它 我们给定一个 5 5 的网格 编号为 1 25 以及一组 5 对点 它们是网格上路径的起点和终点 现在我们需要为这 5 对点找到 5 条对应的路径 这样两条路径就不会重叠 另请
  • 如何在 pytest 中将自定义部分添加到终端报告

    In pytest 当测试用例失败时 您会在报告中看到以下类别 失败详情 捕获的标准输出调用 捕获的 stderr 调用 捕获的调用日志 我想添加一些额外的自定义部分 我有一个并行运行的服务器 并且希望在专用部分中显示该服务器记录的信息 我
  • 不改变url,通过request.user查看

    我正在尝试编写一个视图 在其中检索当前登录用户的信息 我的视图如下所示 只要我将用户传递到 URL 中的视图 它就可以正常工作 def index request username template index html user get
  • 按出现次数对单词列表进行排序的最简单方法

    在 Java 中 按单词在列表中出现的次数对大型单词列表 10 000 20 000 进行排序的最佳 最简单方法是什么 我尝试了基本的实现 但出现内存不足运行时错误 因此我需要一种更有效的方法 你有什么建议 ArrayList
  • 在小型天蓝色实例中使用 Parallel.Foreach

    我有一个在小型实例上运行的 WebRole 该WebRole有一个将大量文件上传到BLOB存储的方法 根据 Azure 实例规范 小型实例只有1 core 那么 在上传这些 blob 时 Parallel Foreach 会比常规 Fore
  • URL 重写 - 查询字符串

    我有一个新闻 博客 网站 当选择单个帖子时 它会返回以下格式的网址 website net sitenews php q posts view postname 12 我正在寻求重写 url 使其显示为 website net sitene
  • 表单上的令牌方法、双重提交问题

    我花了几周的时间来研究我的表单的双重提交保护 直接说 存储令牌的会话方法不起作用 会话对于刷新页面或某人回顾其历史记录来说工作得很好 但是使用会话无法阻止通过多次单击按钮来进行经典的双重提交 我认为当在几毫秒内处理多次点击时 脚本无法足够快
  • Keras - 用于文本分析的自动编码器

    因此 我正在尝试创建一个自动编码器 它将接受文本评论并找到较低维度的表示 我正在使用 keras 我希望我的损失函数能够将 AE 的输出与嵌入层的输出进行比较 不幸的是 它给了我以下错误 我很确定问题出在我的损失函数上 但我似乎无法解决这个