Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc committed Sep 13, 2023
1 parent 5186103 commit 9c08c32
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions jointContribution/PIRBN/rbn_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def __init__(self, n_neu, c, input_shape_last):
)

def forward(self, inputs): # Defines the computation from inputs to outputs
s = self.b * self.b
temp_x = paddle.matmul(inputs, paddle.ones((1, self.n_neu)))
x0 = (
paddle.reshape(
Expand All @@ -80,5 +79,10 @@ def forward(self, inputs): # Defines the computation from inputs to outputs
/ (self.n_neu - 1)
+ self.c[0]
)
x_new = (temp_x - x0) * (temp_x - x0)
return paddle.exp(-x_new * s)
x_new = temp_x - x0
return self.rbf_activate(x_new)

# activation function
def rbf_activate(self, input):
s = self.b * self.b
return paddle.exp(-(input * input) * s)

0 comments on commit 9c08c32

Please sign in to comment.