IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Преглед на файлове

Added weight_variable_glorot

pull/2/head
Stanislaw Adaszewski преди 4 години
родител
ревизия
add6670eb9
променени са 3 файла, в които са добавени 15 реда и са изтрити 0 реда
  1. +2
    -0
      .gitignore
  2. +0
    -0
      decagon_pytorch/convolve.py
  3. +13
    -0
      decagon_pytorch/weight.py

+ 2
- 0
.gitignore Целия файл

@@ -0,0 +1,2 @@
__pycache__


+ 0
- 0
decagon_pytorch/convolve.py Целия файл


+ 13
- 0
decagon_pytorch/weight.py Целия файл

@@ -0,0 +1,13 @@
import torch
import numpy as np
def weight_variable_glorot(input_dim, output_dim):
"""Create a weight variable with Glorot & Bengio (AISTATS 2010)
initialization.
"""
init_range = np.sqrt(6.0 / (input_dim + output_dim))
initial = -init_range + 2 * init_range * \
torch.rand(( input_dim, output_dim ), dtype=torch.float32)
initial = initial.requires_grad_(True)
return initial

Loading…
Отказ
Запис