Skip to content
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

Open
wants to merge 9 commits into
base: main-new-al
Choose a base branch
from

Conversation

manhbao-nguyen
Copy link
Collaborator

No description provided.

Comment on lines -365 to -368
# 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

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?

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.

Copy link
Collaborator Author

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 !

@nikita-0209
Copy link
Collaborator

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 "-"

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.

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

Copy link
Owner

@alexhernandezgarcia alexhernandezgarcia left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants