当前位置:网站首页>nn. PReLU(planes)
nn. PReLU(planes)
2022-06-12 20:58:00 【Human high quality Algorithm Engineer】
PReLU Activation function , Internal source code implementation
def __init__(self, num_parameters: int = 1, init: float = 0.25) -> None:
self.num_parameters = num_parameters
super(PReLU, self).__init__()
self.weight = Parameter(torch.Tensor(num_parameters).fill_(init))
def forward(self, input: Tensor) -> Tensor:
return F.prelu(input, self.weight)
def prelu(input, weight):
# type: (Tensor, Tensor) -> Tensor
r"""prelu(input, weight) -> Tensor Applies element-wise the function :math:`\text{PReLU}(x) = \max(0,x) + \text{weight} * \min(0,x)` where weight is a learnable parameter. See :class:`~torch.nn.PReLU` for more details. """
if not torch.jit.is_scripting():
if type(input) is not Tensor and has_torch_function((input,)):
return handle_torch_function(prelu, (input,), input, weight)
return torch.prelu(input, weight)
The above formula leads to typora Li is in the following form :
weight Here is a learnable parameter , When called nn.PReLU(planes) Only the number of channels is entered , Implement Li Jiang weight Parameters are initialized to 0.25.
This is similar to what we know PRelu The formula is the same ,
边栏推荐
- Before job hopping, Jin San made up the interview questions. Jin San successfully landed at Tencent and got a 30K test offer
- Go -- monitor file changes
- Event distribution mechanism of view
- 2022年春招,测试工程师全套面试攻略,一篇吃透全部技术栈(全是干货)
- Lx09 query tr list of SAP WM preliminary level
- Deploy etcd cluster in static pod mode
- Research Report on market supply and demand and strategy of China's hydraulic injection molding machine industry
- typeScript的定义类型:不能将类型“Timeout”分配给类型“number”;
- Can tonghuashun open an account? Can tonghuashun directly open the security of securities companies on the app? How to open an account online when buying stocks
- The required books for software testers (with e-books) recommended by senior Ali have benefited me a lot
猜你喜欢

Summary of machine learning materials

What are the disadvantages of bone conduction earphones? Analysis of advantages and disadvantages of bone conduction earphones

EditText控制从左上角开始

Why my order by create_ Time ASC becomes order by ASC

Nexus3 build local warehouse

Product Manager: "click here to jump to any page I want to jump" -- decoupling efficiency improving artifact "unified hop routing"

At the same time, do the test. Others have been paid 20W a year. Why are you still working hard to reach 10K a month?

torch. Finfo function

View 的事件分发机制

Fcpx tutorial, how to export video graphics and text in Final Cut Pro?
随机推荐
Lake shore PT-100 platinum resistance temperature sensor
SAP QM preliminary - cannot assign a sampling policy to an inspection characteristic when maintaining an inspection plan by executing transaction code qp02?
leetcode:210. Schedule II
Why my order by create_ Time ASC becomes order by ASC
new做了哪几件事
Summary of machine learning materials
大小端转换
JSP中的监听器
InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY EB3E94ADBE1229CF
test
Minio client (MC command) implements data migration
Troubleshooting of service port failure
Transaction code qs28 of SAP QM preliminary level
Double carbon in every direction: green demand and competition focus in the calculation from the east to the West
Nexus3搭建本地仓库
Can tonghuashun open an account? Can tonghuashun directly open the security of securities companies on the app? How to open an account online when buying stocks
在同花顺开户安全么,买股票怎么网上开户
Integrated monitoring solution for power environment of small and medium-sized computer rooms
竣达技术丨适用于“科士达”智能精密空调网络监控
Listener in JSP