圆鸭蛋 2022-02-25 21:52 采纳率: 0%
浏览 18

Int 这个属性没懂,有没有人可以看一下

class PropertyDonwsteam(tfk.Model):
def init(self, hp):
super().init()
self.my_layers = []
self.concat_at = hp.Int('concat_at', 0, 2)

    for i in range(hp.Int('num_layers', 3, 3)):
        new_step = [               
        tf.keras.layers.Dense(units=hp.Int('units_' + str(i),
                                        min_value=352,
                                        max_value=544,
                                        step=64),),
        
        tf.keras.layers.PReLU(),
        tf.keras.layers.Dropout(hp.Float(
            'dropout_' + str(i),
            min_value=0.0,
            max_value=0.5,
            default=0.25,
            step=0.1,
        )),
        ]

        self.my_layers.append(new_step)
    self.my_layers.append([tf.keras.layers.Dense(1)])

想问一下有没有人知道 hp.Int('concat_at', 0, 2) hp.Int('num_layers', 3, 3)这两句是什么意思啊

  • 写回答

1条回答 默认 最新

  • 关注

    就是 hp对象的.Int()方法,具体的要看hp对象的定义

    评论 编辑记录

报告相同问题?

问题事件

  • 修改了问题 2月25日
  • 创建了问题 2月25日