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
buildseg is a building extraction plugin of QGIS based on PaddlePaddle.

buildseg buildseg is a Building Extraction plugin for QGIS based on PaddlePaddle. How to use Download and install QGIS and clone the repo : git clone

39 Dec 09, 2022
Cours d'Algorithmique Appliquée avec Python pour BTS SIO SISR

Course: Introduction to Applied Algorithms with Python (in French) This is the source code of the website for the Applied Algorithms with Python cours

Loic Yvonnet 0 Jan 27, 2022
Implementation for Homogeneous Unbalanced Regularized Optimal Transport

HUROT: An Homogeneous formulation of Unbalanced Regularized Optimal Transport. This repository provides code related to this preprint. This is an alph

Théo Lacombe 1 Feb 17, 2022
This is an official PyTorch implementation of Task-Adaptive Neural Network Search with Meta-Contrastive Learning (NeurIPS 2021, Spotlight).

NeurIPS 2021 (Spotlight): Task-Adaptive Neural Network Search with Meta-Contrastive Learning This is an official PyTorch implementation of Task-Adapti

Wonyong Jeong 15 Nov 21, 2022
SafePicking: Learning Safe Object Extraction via Object-Level Mapping, ICRA 2022

SafePicking Learning Safe Object Extraction via Object-Level Mapping Kentaro Wad

Kentaro Wada 49 Oct 24, 2022
Single-Shot Motion Completion with Transformer

Single-Shot Motion Completion with Transformer 👉 [Preprint] 👈 Abstract Motion completion is a challenging and long-discussed problem, which is of gr

FuxiCV 78 Dec 29, 2022
SwinIR: Image Restoration Using Swin Transformer

SwinIR: Image Restoration Using Swin Transformer This repository is the official PyTorch implementation of SwinIR: Image Restoration Using Shifted Win

Jingyun Liang 2.4k Jan 08, 2023
A fast model to compute optical flow between two input images.

DCVNet: Dilated Cost Volumes for Fast Optical Flow This repository contains our implementation of the paper: @InProceedings{jiang2021dcvnet, title={

Huaizu Jiang 8 Sep 27, 2021
Code & Data for Enhancing Photorealism Enhancement

Enhancing Photorealism Enhancement Stephan R. Richter, Hassan Abu AlHaija, Vladlen Koltun Paper | Website (with side-by-side comparisons) | Video (Pap

Intelligent Systems Lab Org 1.1k Dec 31, 2022
PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation

PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation Created by Charles R. Qi, Hao Su, Kaichun Mo, Leonidas J. Guibas from Sta

Charles R. Qi 4k Dec 30, 2022
✂️ EyeLipCropper is a Python tool to crop eyes and mouth ROIs of the given video.

EyeLipCropper EyeLipCropper is a Python tool to crop eyes and mouth ROIs of the given video. The whole process consists of three parts: frame extracti

Zi-Han Liu 9 Oct 25, 2022
Count the MACs / FLOPs of your PyTorch model.

THOP: PyTorch-OpCounter How to install pip install thop (now continously intergrated on Github actions) OR pip install --upgrade git+https://github.co

Ligeng Zhu 3.9k Dec 29, 2022
A deep learning network built with TensorFlow and Keras to classify gender and estimate age.

Convolutional Neural Network (CNN). This repository contains a source code of a deep learning network built with TensorFlow and Keras to classify gend

Pawel Dziemiach 1 Dec 18, 2021
Official repository for the paper "Going Beyond Linear Transformers with Recurrent Fast Weight Programmers"

Recurrent Fast Weight Programmers This is the official repository containing the code we used to produce the experimental results reported in the pape

IDSIA 36 Nov 15, 2022
This repository provides an efficient PyTorch-based library for training deep models.

s3sec Test AWS S3 buckets for read/write/delete access This tool was developed to quickly test a list of s3 buckets for public read, write and delete

Bytedance Inc. 123 Jan 05, 2023
Official code of "R2RNet: Low-light Image Enhancement via Real-low to Real-normal Network."

R2RNet Official code of "R2RNet: Low-light Image Enhancement via Real-low to Real-normal Network." Jiang Hai, Zhu Xuan, Ren Yang, Yutong Hao, Fengzhu

77 Dec 24, 2022
Instance-Dependent Partial Label Learning

Instance-Dependent Partial Label Learning Installation pip install -r requirements.txt Run the Demo benchmark-random mnist python -u main.py --gpu 0 -

17 Dec 29, 2022
NCNN implementation of Real-ESRGAN. Real-ESRGAN aims at developing Practical Algorithms for General Image Restoration.

NCNN implementation of Real-ESRGAN. Real-ESRGAN aims at developing Practical Algorithms for General Image Restoration.

Xintao 593 Jan 03, 2023
This repo is the official implementation of "L2ight: Enabling On-Chip Learning for Optical Neural Networks via Efficient in-situ Subspace Optimization".

L2ight is a closed-loop ONN on-chip learning framework to enable scalable ONN mapping and efficient in-situ learning. L2ight adopts a three-stage learning flow that first calibrates the complicated p

Jiaqi Gu 9 Jul 14, 2022