data.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:five-video-classification-methods 作者: harvitronix 项目源码 文件源码
def get_class_one_hot(self, class_str):
        """Given a class as a string, return its number in the classes
        list. This lets us encode and one-hot it for training."""
        # Encode it first.
        label_encoded = self.classes.index(class_str)

        # Now one-hot it.
        label_hot = to_categorical(label_encoded, len(self.classes))

        assert len(label_hot) == len(self.classes)

        return label_hot
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号