Skip to content

chp06 4_lenet.ipynb #53

Description

@Ethan-Chen-plus

Cell in 6有这样的一段代码:

if cell.has_bias:
        fan_in, _ = _calculate_fan_in_and_fan_out(cell.weight.shape)
        bound = 1 / math.sqrt(fan_in)
        cell.bias.set_data(initializer(Uniform(bound), [cell.out_channels]))

想请问这个是什么意思?在pytorch原版代码中没有看到类似的操作,为什么要增加一个额外的初始化has_bias的操作呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions