-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ian Goodfellow
committed
Jul 7, 2011
1 parent
22c32e0
commit 03d56df
Showing
6 changed files
with
90 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,3 +85,5 @@ | |
|
||
mu = g1.mean(axis=0) | ||
print (mu.min(),mu.max()) | ||
std = g1.mean(axis=0) | ||
print (std.min(),std.max()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,34 @@ | ||
|
||
import theano.tensor as T | ||
from theano import function | ||
|
||
class FEBM: | ||
"""Free Energy-Based Model: An Energy-Based Model with no latent variables """ | ||
|
||
def __init__(self, energy_function): | ||
self.energy_function | ||
self.energy_function = energy_function | ||
self.batches_seen = 0 | ||
self.examples_seen = 0 | ||
# | ||
|
||
def free_energy(self, X): | ||
return self.energy_function(X) | ||
# | ||
|
||
def score(self, X): | ||
return self.energy_function.score(X) | ||
# | ||
|
||
def censor_updates(self, updates): | ||
self.energy_function.censor_updates(updates) | ||
# | ||
|
||
def get_params(self): | ||
return self.energy_function.get_params() | ||
# | ||
|
||
def redo_theano(self): | ||
X = T.matrix() | ||
|
||
self.E_X_batch_func = function([X],self.energy_function(X)) | ||
# | ||
# |