-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Few Cleanings on main-new-al #19
base: main-new-al
Are you sure you want to change the base?
Conversation
# if energy_weighting: | ||
# for key in dict_return.keys(): | ||
# if key != 'energy': | ||
# dict_return[key] = dict_return[key] * np.tanh(np.abs(energies)/2) # positive tahn of the energies, scaled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not critical, but what was the reason to remove this part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code should not have been removed, because pins and pairs and motifs are relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, to add a new oracle in oracle.py, we just have to create a new child class of OracleBase (mother class of all oracles), and add it in the wrapper class that calls the relevant oracle Oracle.
Right now, OracleNupack just outputs the energies given by Nupack (in the get_score method). We did not include the other scores given by Nupack yet, but we will.
We just have to discuss if we add these other oracle functions of Nupack (pins, pairs) in other classes, or all in the same big OracleNupack. The better would be to stick to previous code and have a very general Nupack oracle that computes all Nupack statistics (pins, pairs), we will have to add a specific parameter in the config file so that the user specifies which Nupack stats he wants if he selects oracle.main = "nupack".
To be discussed !
As we discussed Bao, the negative sign on line number 315 should be removed, right? Is the plan to do that in a separate PR? |
oracle.py
Outdated
@@ -183,7 +185,7 @@ def get_score(self, queries): | |||
raise NotImplementedError | |||
|
|||
self.model.eval() | |||
outputs = self.model(tensor4oracle) | |||
outputs = - self.model(tensor4oracle) #This MLP toy oracle was trained on the opposite of Nupack energies, so we revert to negative energies with "-" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move side comment to above the line it refers to
oracle.py
Outdated
@@ -223,7 +225,7 @@ def base2oracle(self, state): | |||
return seq | |||
|
|||
def get_score(self, queries): | |||
count_zero = lambda x: float(np.count_nonzero(x == 1)) | |||
count_zero = lambda x: - float(np.count_nonzero(x == 1)) #Toy energy : opposite of the number of 1 ie T in the DNA sequence. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move side comment to above the line it refers to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comments about the pins, pairs, motifs, etc. code and about side comments
No description provided.