Code for the paper "JANUS: Parallel Tempered Genetic Algorithm Guided by Deep Neural Networks for Inverse Molecular Design"

Related tags

Deep LearningJANUS
Overview

JANUS: Parallel Tempered Genetic Algorithm Guided by Deep Neural Networks for Inverse Molecular Design

This repository contains code for the paper: JANUS: Parallel Tempered Genetic Algorithm Guided by Deep Neural Networks for Inverse Molecular Design. By: AkshatKumar Nigam, Robert Pollice, Alán Aspuru-Guzik

Package Requirements:

Using The Code:

The code can be run using:

python ./JANUS.py

Within params_init.py, a user has the option to provide:

  1. A function for calculting property values (see function calc_prop).
  2. Input parameters that are to be used by JANUS (see function generate_params). Initial parameters are provided. These are picked based on prior experience by the authors of the paper.

Output Generation:

All results from running JANUS will be stored here. The following files will be created:

  1. fitness_explore.txt: Fitness values for all molecules from the exploration component of JANUS.
  2. fitness_local_search.txt: Fitness values for all molecules from the exploitation component of JANUS.
  3. generation_all_best.txt: Smiles and fitness value for the best molecule encountered in every generation (iteration).
  4. init_mols.txt: List of molecules used to initialte JANUS.
  5. population_explore.txt: SMILES for all molecules from the exploration component of JANUS.
  6. population_local_search.txt: SMILES for all molecules from the exploitation component of JANUS.

Paper Results/Reproducibility:

Our code and results for each experiment in the paper can be found here:

Questions, problems?

Make a github issue 😄 . Please be as clear and descriptive as possible. Please feel free to reach out in person: (akshat[DOT]nigam[AT]mail[DOT]utoronto[DOT]ca, rob[DOT]pollice[AT]utoronto[DOT]ca)

License

Apache License 2.0

Comments
  • freeze_support runtime error with provided example

    freeze_support runtime error with provided example

    Hello, I'm trying out JANUS and if I just run the example inside the tests as provided I get

      File "/Users/nsofroniew/opt/anaconda3/envs/chem/lib/python3.9/multiprocessing/spawn.py", line 134, in _check_not_importing_main
        raise RuntimeError('''
    RuntimeError:
            An attempt has been made to start a new process before the
            current process has finished its bootstrapping phase.
    
            This probably means that you are not using fork to start your
            child processes and you have forgotten to use the proper idiom
            in the main module:
    
                if __name__ == '__main__':
                    freeze_support()
                    ...
    
            The "freeze_support()" line can be omitted if the program
            is not going to be frozen to produce an executable.
    

    This can be fixed by wrapping the creation and running of the JANUS agent and inside

    if __name__ == '__main__':
        torch.multiprocessing.freeze_support()
    

    see for a similar fix https://github.com/pytorch/pytorch/issues/5858#issuecomment-373950687

    I'm happy to submit a PR to fix if you like - it will be very simple

    opened by sofroniewn 4
  • Enquiring on multi-objective fitness function

    Enquiring on multi-objective fitness function

    Hi, I would like to ask if there are multiple objectives which I want the fitness function to fulfil, how would I write out the function because the example on the README.md is only for one objective (logP)?

    Thank you! :D

    opened by yipy0005 3
  • error in numpy/ list multiplication inside mutate_smi_list

    error in numpy/ list multiplication inside mutate_smi_list

    Hello, I am trying to run the provided example, but get the following error

    $ python ./example.py
        Unique and valid fragments generated: 107308
        Unique and valid fragments generated: 107308
    On generation 0/200
    /Users/nsofroniew/opt/anaconda3/envs/chem/lib/python3.9/site-packages/janus/janus.py:457: RuntimeWarning: overflow encountered in power
      prob_ = 1.0 / (3.0 ** ((F_50_val - fitness) / (F_50_val - F_25_val)) + 1)
        (Explr) Top Fitness: 15.811199999999957
        (Explr) Top Smile: CCCCCCCCCCCCCCCCOP(=O)(O)Oc1ccc(C=Cc2ccc(OP(=O)(O)OCCCCCCCCCCCCCCCC)cc2)cc1
    Traceback (most recent call last):
      File "/Users/nsofroniew/Documents/code/chem/janus/tests/./example.py", line 81, in <module>
      File "/Users/nsofroniew/opt/anaconda3/envs/chem/lib/python3.9/site-packages/janus/janus.py", line 317, in run
        mut_smi_loc = self.mutate_smi_list(smiles_local_search, "local")
      File "/Users/nsofroniew/opt/anaconda3/envs/chem/lib/python3.9/site-packages/janus/janus.py", line 137, in mutate_smi_list
        smi_list = smi_list * num_random_samples
    numpy.core._exceptions._UFuncNoLoopError: ufunc 'multiply' did not contain a loop with signature matching types (dtype('<U98'), dtype('int64')) -> None
    

    It looks like smi_list has become a numpy array, which is unintended and it should be a list. This can be fixed by making this line https://github.com/aspuru-guzik-group/JANUS/blob/a52e5994a108063e3fc1d692752cea0ff0240120/src/janus/janus.py#L137 be

        smi_list = list(smi_list) * num_random_samples
    

    There could be other, more desirable fixes that avoid this problem altogether. I am happy to submit a PR if this fix is desired though.

    opened by sofroniewn 2
  • Unhandled exceptions and KeyError

    Unhandled exceptions and KeyError

    I tried running JANUS.py but got a number of exceptions. In addition, the script terminated with a KeyError.

    Initial population obtained!
    Forming Fragments!
        Fragment creation: 0/10000
        Fragment creation: 1000/10000
        Fragment creation: 2000/10000
        Fragment creation: 3000/10000
        Fragment creation: 4000/10000
        Fragment creation: 5000/10000
        Fragment creation: 6000/10000
        Fragment creation: 7000/10000
        Fragment creation: 8000/10000
        Fragment creation: 9000/10000
    Process Process-5:
    Traceback (most recent call last):
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
        self.run()
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 99, in run
        self._target(*self._args, **self._kwargs)
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 205, in calc_parr_prop
        props_collect[property_name][smile] = get_prop_material(smile, alphabet=alphabet, num_random_samples=num_random_samples, num_mutations=num_mutations)  # TODO: TESTING
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in get_prop_material
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in 
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 59, in decoder
        rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 147, in _derive_mol_from_symbols
        _raise_decoder_error(selfies, symbol)
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 179, in _raise_decoder_error
        raise DecoderError(err_msg)
    selfies.exceptions.DecoderError: invalid symbol '[Branch3_1]'
    	SELFIES: [S][C][=N][N][=C][Branch1][Ring1][C][C][C][Branch1][#Branch1][O][C][Branch1][C][C][=O][C][Branch1][C][C][Branch1][C][C][C][N][N][N][Branch3_1][C][C][=C][=C][Branch1][C][N][C][=C][Ring1][#Branch1][C][#Branch1][N]
    Process Process-7:
    Traceback (most recent call last):
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
        self.run()
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 99, in run
        self._target(*self._args, **self._kwargs)
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 205, in calc_parr_prop
        props_collect[property_name][smile] = get_prop_material(smile, alphabet=alphabet, num_random_samples=num_random_samples, num_mutations=num_mutations)  # TODO: TESTING
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in get_prop_material
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in 
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 59, in decoder
        rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 124, in _derive_mol_from_symbols
        _raise_decoder_error(selfies, symbol)
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 179, in _raise_decoder_error
        raise DecoderError(err_msg)
    selfies.exceptions.DecoderError: invalid symbol '[Expl=Ring3]'
    	SELFIES: [C][Expl=Ring3][=C][Branch2][Ring1][=Branch1][C][=C][C][=C][Branch1][#C][C][=C][Ring1][=Branch1][C][=C][C][=C][C][=C][Ring1][=Branch1][Ring1][=C][F][C][Branch1][C][C][C][C][C][N][Branch1][=Branch2][S][Branch1][C][C][=Branch1][C][=O][=O][C][C][Ring1][#Branch2][C][N][Branch1][Branch1][C][C][C][C][C][C][C][C]
    Process Process-4:
    Traceback (most recent call last):
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
        self.run()
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 99, in run
        self._target(*self._args, **self._kwargs)
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 205, in calc_parr_prop
        props_collect[property_name][smile] = get_prop_material(smile, alphabet=alphabet, num_random_samples=num_random_samples, num_mutations=num_mutations)  # TODO: TESTING
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in get_prop_material
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in 
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 59, in decoder
        rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 116, in _derive_mol_from_symbols
        init_state=binit_state, root_atom=prev_atom, rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 147, in _derive_mol_from_symbols
        _raise_decoder_error(selfies, symbol)
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 179, in _raise_decoder_error
        raise DecoderError(err_msg)
    selfies.exceptions.DecoderError: invalid symbol '[Branch1_3]'
    	SELFIES: [C][C][=C][Branch1][=Branch1][C][C][=Ring1][=Branch1][Branch1_3][C][C][=C][C][=C][Branch1][C][C][=C][C][=C][Branch1][C][N][C][=N][Ring1][#Branch1][#Branch2][C][N][C][O][C][C][Ring1][=Branch1][C][Branch1][C][O][=C][C][=C][Ring1][=C][O][Ring1][P]
    Process Process-6:
    Traceback (most recent call last):
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
        self.run()
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 99, in run
        self._target(*self._args, **self._kwargs)
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 205, in calc_parr_prop
        props_collect[property_name][smile] = get_prop_material(smile, alphabet=alphabet, num_random_samples=num_random_samples, num_mutations=num_mutations)  # TODO: TESTING
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in get_prop_material
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in 
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 59, in decoder
        rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 116, in _derive_mol_from_symbols
        init_state=binit_state, root_atom=prev_atom, rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 147, in _derive_mol_from_symbols
        _raise_decoder_error(selfies, symbol)
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 179, in _raise_decoder_error
        raise DecoderError(err_msg)
    selfies.exceptions.DecoderError: invalid symbol '[Branch3_2]'
    	SELFIES: [C][C][=Branch1][#C][=C][C][=C][C][=Ring1][=Branch1][C][Branch1][C][F][Branch1][C][F][F][C][C][Branch1][C][C][=N][N][C][=Branch1][C][C][C][N][C][C][C][Branch1][C][N][C][C][Ring1][#Branch1][C][O][=C][C][Branch1][O][C][Branch3_2][C][N][C][C][O][C][C][Ring1][=Branch1][=O]
    Process Process-8:
    Traceback (most recent call last):
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
        self.run()
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 99, in run
        self._target(*self._args, **self._kwargs)
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 205, in calc_parr_prop
        props_collect[property_name][smile] = get_prop_material(smile, alphabet=alphabet, num_random_samples=num_random_samples, num_mutations=num_mutations)  # TODO: TESTING
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in get_prop_material
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in 
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 59, in decoder
        rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 116, in _derive_mol_from_symbols
        init_state=binit_state, root_atom=prev_atom, rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 116, in _derive_mol_from_symbols
        init_state=binit_state, root_atom=prev_atom, rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 147, in _derive_mol_from_symbols
        _raise_decoder_error(selfies, symbol)
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 179, in _raise_decoder_error
        raise DecoderError(err_msg)
    selfies.exceptions.DecoderError: invalid symbol '[Branch2_1]'
    	SELFIES: [C][=Branch1][C][=O][Branch1][C][O][C][N][C][=Branch1][C][=O][C][Branch2][Ring1][=Branch1][N][C][=Branch1][C][=O][C][Branch1][N][C][=C][C][=C][C][Branch2_1][Ring2][=N][Ring1][=Branch1][N][=N][O][C][Ring2][Ring1][C][S][C][C][=Ring2][Ring1][=Branch1][S][C][S][N][=C][Branch1][Ring2][N][=Ring1][Branch1][S][C][C][N]
    Process Process-11:
    Traceback (most recent call last):
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
        self.run()
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 99, in run
        self._target(*self._args, **self._kwargs)
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 205, in calc_parr_prop
        props_collect[property_name][smile] = get_prop_material(smile, alphabet=alphabet, num_random_samples=num_random_samples, num_mutations=num_mutations)  # TODO: TESTING
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in get_prop_material
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in 
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 59, in decoder
        rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 147, in _derive_mol_from_symbols
        _raise_decoder_error(selfies, symbol)
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 179, in _raise_decoder_error
        raise DecoderError(err_msg)
    selfies.exceptions.DecoderError: invalid symbol '[Branch2_3]'
    	SELFIES: [C][C][=C][C][Branch1][=C][C][N][Branch1][C][C][N][C][=Branch1][C][=O][C][S][C][C][C][Ring1][#Branch1][=C][C][=Ring1][O][C][=C][C][=C][C][=C][Ring1][=Branch1][O][C][=C][Branch2_3][Branch1]
    Process Process-10:
    Traceback (most recent call last):
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
        self.run()
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 99, in run
        self._target(*self._args, **self._kwargs)
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 205, in calc_parr_prop
        props_collect[property_name][smile] = get_prop_material(smile, alphabet=alphabet, num_random_samples=num_random_samples, num_mutations=num_mutations)  # TODO: TESTING
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in get_prop_material
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in 
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 59, in decoder
        rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 116, in _derive_mol_from_symbols
        init_state=binit_state, root_atom=prev_atom, rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 116, in _derive_mol_from_symbols
        init_state=binit_state, root_atom=prev_atom, rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 147, in _derive_mol_from_symbols
        _raise_decoder_error(selfies, symbol)
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 179, in _raise_decoder_error
        raise DecoderError(err_msg)
    selfies.exceptions.DecoderError: invalid symbol '[Branch3_3]'
    	SELFIES: [F][C][=C][C][=C][Branch2][Ring2][O][C][N][C][Branch2][Ring2][Ring2][C][Branch1][#C][C][C][=C][Branch1][=Branch2][C][=C][C][=C][C][=Branch1][C][=O][N][Branch1][C][C][Branch3_3][C][Branch1][C][F][C][=Ring1][#Branch1][F][=N][C][C][Ring1][C][N][C][C][N][C][C][Ring1][=Branch1][=C][=N][C][=Branch1][Branch1][=N][C][=Ring1][=Branch1][N][Branch1][C][C][C][=O][C][=C][Ring2][Ring1][=N]
    Process Process-9:
    Traceback (most recent call last):
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
        self.run()
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 99, in run
        self._target(*self._args, **self._kwargs)
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 205, in calc_parr_prop
        props_collect[property_name][smile] = get_prop_material(smile, alphabet=alphabet, num_random_samples=num_random_samples, num_mutations=num_mutations)  # TODO: TESTING
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in get_prop_material
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in 
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 59, in decoder
        rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 116, in _derive_mol_from_symbols
        init_state=binit_state, root_atom=prev_atom, rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 116, in _derive_mol_from_symbols
        init_state=binit_state, root_atom=prev_atom, rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 147, in _derive_mol_from_symbols
        _raise_decoder_error(selfies, symbol)
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 179, in _raise_decoder_error
        raise DecoderError(err_msg)
    selfies.exceptions.DecoderError: invalid symbol '[Branch3_3]'
    	SELFIES: [C][C][Branch1][#Branch2][C][=C][C][=Branch1][Ring2][=C][=Branch1][F][=N][C][=C][Branch2][Ring2][Branch1][N][Branch1][Branch2][C][=N][C][Ring1][=Branch1][=Ring1][=C][N][=C][C][=C][C][=C][Branch1][P][C][=Branch1][Ring2][=C][Ring1][=Branch1][C][Branch3_3][C][N][=C][C][=C][C][=Ring1][=Branch1][O][C][O]
    On generation 0/200
        (Explr) Top Fitness: 1.0
        (Explr) Top Smile: C=C1N=CC=C(N=CNc2ccc(N)cc2)N=C(C)[SH]1C
    Process Process-27:
    Traceback (most recent call last):
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
        self.run()
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/multiprocessing/process.py", line 99, in run
        self._target(*self._args, **self._kwargs)
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 205, in calc_parr_prop
        props_collect[property_name][smile] = get_prop_material(smile, alphabet=alphabet, num_random_samples=num_random_samples, num_mutations=num_mutations)  # TODO: TESTING
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in get_prop_material
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/software/JANUS/mutate_parr.py", line 129, in 
        mutated_smiles = [decoder(x) for x in mutated_sf]
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 59, in decoder
        rings=rings
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 147, in _derive_mol_from_symbols
        _raise_decoder_error(selfies, symbol)
      File "/home/ubuntu/anaconda3/envs/reinvent.v3.2/lib/python3.7/site-packages/selfies/decoder.py", line 179, in _raise_decoder_error
        raise DecoderError(err_msg)
    selfies.exceptions.DecoderError: invalid symbol '[Branch3_2]'
    	SELFIES: [C][O][=C][N][C][N][C][=Branch1][C][=O][N][Branch1][=Branch1][N+1][=Branch1][C][=O][O-1][C][Ring1][=Branch2][N][Ring1][N][O][C][=C][C][C][N][C][N][C][N][C][=C][C][=C][Branch1][C][F][C][Branch1][C][F][=C][Ring1][Branch2][=N][C][Branch1][C][C][Branch3_2][Branch1][=Branch1][C][Branch1][C][C][=O][S][Ring1][=Branch2][=C][C][=Ring1][#Branch1][N][C][N][C][C][=C][C][=C][C][=C][Ring1][=Branch1][C][N][=C][Branch1][=C][SH1][Branch1][C][C][C][=C][C][=C][C][=C][Ring1][=Branch1][=Branch1][C][=C][N][=C][C][=Ring1][#Branch2][C]
    Traceback (most recent call last):
      File "./JANUS.py", line 308, in 
        mut_smi_dict_local  = mut_smi_dict_local[population[top_idx]]
    KeyError: 'C=C1N=CC=C(N=CNc2ccc(N)cc2)N=C(C)[SH]1C'
    
    opened by PatWalters 2
  • multiprocessing in windows

    multiprocessing in windows

    Hi. I was run the code, but I met errors in all codes that used multiprocessing. As I know these errors came from the difference of OS.

    Since I use Windows, I wonder how to correct the code for Windows.

    Thanks.

    opened by gunwook12 1
  • "aux" folder name should be changed to make the repository compatible with Windows.

    It looks like "aux" is a reserved word in Windows and directory of this name cannot be used. This is causing error, when I try to clone the repository.

    opened by sptiwari 1
  • Question: How sensitive is the model to molecule initialization?

    Question: How sensitive is the model to molecule initialization?

    Hello, great work! I'm excited to try this out for a chemical design project I'm working on. One question that I had after reading the pre-print— how sensitive is the model to molecule initialization?

    I read that you can start JANUS with random molecules or provide it with defined molecules. Did you perform any tests on what happens if the best molecule's scaffold was ablated from the initial bank of molecules? And how much, if at all, does rational initialization improve over random molecular initialization? Does this relate back to being trapped in local minima, and would the choice of initialization help explore more chemical space?

    Thank you!

    question 
    opened by jrhorne 1
Releases(v1)
Owner
Aspuru-Guzik group repo
Aspuru-Guzik group repo
Convert Pytorch model to onnx or tflite, and the converted model can be visualized by Netron

Convert Pytorch model to onnx or tflite, and the converted model can be visualized by Netron

Roxbili 5 Nov 19, 2022
DeepOBS: A Deep Learning Optimizer Benchmark Suite

DeepOBS - A Deep Learning Optimizer Benchmark Suite DeepOBS is a benchmarking suite that drastically simplifies, automates and improves the evaluation

Aaron Bahde 7 May 12, 2020
CoReNet is a technique for joint multi-object 3D reconstruction from a single RGB image.

CoReNet CoReNet is a technique for joint multi-object 3D reconstruction from a single RGB image. It produces coherent reconstructions, where all objec

Google Research 80 Dec 25, 2022
This is the code repository implementing the paper "TreePartNet: Neural Decomposition of Point Clouds for 3D Tree Reconstruction".

TreePartNet This is the code repository implementing the paper "TreePartNet: Neural Decomposition of Point Clouds for 3D Tree Reconstruction". Depende

刘彦超 34 Nov 30, 2022
You are AllSet: A Multiset Function Framework for Hypergraph Neural Networks.

AllSet This is the repo for our paper: You are AllSet: A Multiset Function Framework for Hypergraph Neural Networks. We prepared all codes and a subse

Jianhao 51 Dec 24, 2022
NLP From Scratch Without Large-Scale Pretraining: A Simple and Efficient Framework

NLP From Scratch Without Large-Scale Pretraining This repository contains the code, pre-trained model checkpoints and curated datasets for our paper:

Xingcheng Yao 224 Dec 08, 2022
It's a implement of this paper:Relation extraction via Multi-Level attention CNNs

Relation Classification via Multi-Level Attention CNNs It's a implement of this paper:Relation Classification via Multi-Level Attention CNNs. Training

Aybss 2 Nov 04, 2022
Parameter Efficient Deep Probabilistic Forecasting

PEDPF Parameter Efficient Deep Probabilistic Forecasting (PEDPF) is a repository containing code to run experiments for several deep learning based pr

Olivier Sprangers 10 Jun 13, 2022
Single object tracking and segmentation.

Single/Multiple Object Tracking and Segmentation Codes and comparison of recent single/multiple object tracking and segmentation. News 💥 AutoMatch is

ZP ZHANG 385 Jan 02, 2023
A denoising diffusion probabilistic model synthesises galaxies that are qualitatively and physically indistinguishable from the real thing.

Realistic galaxy simulation via score-based generative models Official code for 'Realistic galaxy simulation via score-based generative models'. We us

Michael Smith 32 Dec 20, 2022
Implementation of a Transformer, but completely in Triton

Transformer in Triton (wip) Implementation of a Transformer, but completely in Triton. I'm completely new to lower-level neural net code, so this repo

Phil Wang 152 Dec 22, 2022
Official implementation for Likelihood Regret: An Out-of-Distribution Detection Score For Variational Auto-encoder at NeurIPS 2020

Likelihood-Regret Official implementation of Likelihood Regret: An Out-of-Distribution Detection Score For Variational Auto-encoder at NeurIPS 2020. T

Xavier 33 Oct 12, 2022
Graph Convolutional Networks for Temporal Action Localization (ICCV2019)

Graph Convolutional Networks for Temporal Action Localization This repo holds the codes and models for the PGCN framework presented on ICCV 2019 Graph

Runhao Zeng 318 Dec 06, 2022
Designing a Practical Degradation Model for Deep Blind Image Super-Resolution (ICCV, 2021) (PyTorch) - We released the training code!

Designing a Practical Degradation Model for Deep Blind Image Super-Resolution Kai Zhang, Jingyun Liang, Luc Van Gool, Radu Timofte Computer Vision Lab

Kai Zhang 804 Jan 08, 2023
Using Python to Play Cyberpunk 2077

CyberPython 2077 Using Python to Play Cyberpunk 2077 This repo will contain code from the Cyberpython 2077 video series on Youtube (youtube.

Harrison 118 Oct 18, 2022
The official PyTorch implementation of Curriculum by Smoothing (NeurIPS 2020, Spotlight).

Curriculum by Smoothing (NeurIPS 2020) The official PyTorch implementation of Curriculum by Smoothing (NeurIPS 2020, Spotlight). For any questions reg

PAIR Lab 36 Nov 23, 2022
Image Recognition using Pytorch

PyTorch Project Template A simple and well designed structure is essential for any Deep Learning project, so after a lot practice and contributing in

Sarat Chinni 1 Nov 02, 2021
Negative Sample Matters: A Renaissance of Metric Learning for Temporal Grounding

2D-TAN (Optimized) Introduction This is an optimized re-implementation repository for AAAI'2020 paper: Learning 2D Temporal Localization Networks for

Joya Chen 112 Dec 31, 2022