TensorFlow:根据特征条件变换张量
非常感谢您阅读我的问题。我对 TensorFlow 很陌生,很抱歉,如果我的问题完全没有意义,我有这个回归问题:
A = Input(shape=(8))
A0 = A[:,0:4]
A1 = A[:,4:8]
A0 = layers.Dense(12)(A0)
A1 = layers.Dense(12)(A1)
Z = layers.Concatenate()([A0,A1])
Z = layers.Dense(1)(Z)
model = Model(inputs=A, outputs=Z)
其中输入有两组特征,观察 A0 && A1 即来自
。两个独立设备
的[温度、湿度、紫外线、污染物]
- 如果我知道这两个集合之间存在相互依赖关系,并且我想根据
Dense()(A1)
的输出来转换
A0
喜欢---->A0 取决于 [A1 ?!@?#-> 中找到的功能A0]
- 并且我还希望最后一层
Z 仅取决于 A0
我应该使用什么样的方法?这样的事情有意义吗?或 Tf.Cond 或 if 条件?
A0 = layers.Dense(12)(A0)
A1 = layers.Dense(12)(A1)
Z = layers.Concatenate()([A0,A1])
Z = layers.Dense(12)(Z)
Z = A0 + Z
Z = layers.Dense(1)(Z)
我正在寻找看起来更好看和优雅的东西,或者您可以指出一条路径,例如我可以查看的一些相关研究吗?
我认为我的主要问题是我什至不知道该看什么,因为它不完全是 if 条件
/tf.case
问题
非常感谢您的时间
非常感谢
Thank you very much for reading my question. I'm quite new to TensorFlow so sorry if my problem doesn't completely make sense, I have this regression problem :
A = Input(shape=(8))
A0 = A[:,0:4]
A1 = A[:,4:8]
A0 = layers.Dense(12)(A0)
A1 = layers.Dense(12)(A1)
Z = layers.Concatenate()([A0,A1])
Z = layers.Dense(1)(Z)
model = Model(inputs=A, outputs=Z)
wherein the input there are two sets of features, observation A0 && A1
ie.[temperature, humidity, UV, pollutants]
from two separate devices
.
- if I knew there is an interdependency between these two sets and I want to
transform
A0
based on the output ofDense()(A1)
something like ---->A0 depends on the features found within [A1 ?!@?#-> A0]
- and I also want final layer
Z to only depends on A0
what kind of method should I use? would something like this make sense? or Tf.Cond or if conditions?
A0 = layers.Dense(12)(A0)
A1 = layers.Dense(12)(A1)
Z = layers.Concatenate()([A0,A1])
Z = layers.Dense(12)(Z)
Z = A0 + Z
Z = layers.Dense(1)(Z)
I'm looking for something that seems better looking and elegant, or may you please point out a path like some relevant studies that I can look at?
I think my main problem is I don't even know what to look at, as it is not exactly an if condition
/tf.case
problem
Thank you very much for your time
Many Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论