diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c20c2ab --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__ + diff --git a/decagon_pytorch/convolve.py b/decagon_pytorch/convolve.py new file mode 100755 index 0000000..e69de29 diff --git a/decagon_pytorch/weight.py b/decagon_pytorch/weight.py new file mode 100755 index 0000000..5321660 --- /dev/null +++ b/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