mirror of
https://github.com/InternLM/InternBootcamp.git
synced 2026-04-19 12:58:04 +00:00
fix(ChemStructure2Property): implement scoring system for logP prediction
- Add random selection of InChI and SMILES strings - Implement relative error-based scoring for logP prediction - Update verification functions to return scores instead of boolean - Refactor InChI and SMILES generation for better randomness
This commit is contained in:
parent
9773357be4
commit
fb4009b871
3 changed files with 69 additions and 18 deletions
|
|
@ -9,7 +9,7 @@ class InChIGenerator:
|
|||
def __init__(self, max_atoms=15, min_atoms=3, elements=None,
|
||||
seed=None):
|
||||
RDLogger.DisableLog('rdApp.*')
|
||||
random.seed(42) if seed is None else random.seed(seed)
|
||||
random.seed(seed)
|
||||
self.max_atoms = max_atoms
|
||||
self.min_atoms = min_atoms
|
||||
if elements is None:
|
||||
|
|
@ -123,7 +123,7 @@ class SMILESGenerator:
|
|||
def __init__(self, min_len=5, max_len=25,
|
||||
seed=None):
|
||||
RDLogger.DisableLog('rdApp.*')
|
||||
random.seed(42) if seed is None else random.seed(seed)
|
||||
random.seed(seed)
|
||||
self.min_len = min_len
|
||||
self.max_len = max_len
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue