简体   繁体   English

如何使用Keras构建一个resnet来训练和预测主类中的子类?

[英]How to build a resnet with Keras that trains and predicts the subclass from the main class?

I would like go implement a hierarchical resnet architecture. 我想实现一个分层的resnet架构。 However, I could not find any solution for this. 但是,我找不到任何解决方案。 For example, my data structure is like: 例如,我的数据结构如下:

  • class A A级
    • Subclass 1 子类1
    • Subclass 2 子类2
    • .... ....
  • class B B级
    • subclass 6 子类6
    • ........ ........

So i would like to train and predict the main class and then the subclass of the chosen/predicted mainclass. 所以我想训练和预测主类,然后是所选/预测主类的子类。 Can someone provide a simple example how to do this with generators? 有人可以提供一个简单的例子如何使用生成器执行此操作?

The easiest way to do so would be to train multiple classifiers and build a hierarchical system by yourself. 最简单的方法是训练多个分类器并自己构建一个分层系统。

One classifier detecting class A, B etc. After that make a new prediction for subclasses. 一个分类器检测类A,B等。之后对子类进行新的预测。

If you want only one single classifier: What about just killing the first hierarchy of parent classes? 如果你只想要一个单独的分类器:那么只是杀死父类的第一层次结构呢? Should be also quite easy. 应该也很容易。 If you really want a model, where the hierarchy is learned take a look at Hierarchical Multi-Label Classification Networks. 如果您确实需要一个模型,在该模型中学习层次结构,请查看分层多标签分类网络。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM