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

Related tags

Deep Learning JANUS
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
Inference code for "StylePeople: A Generative Model of Fullbody Human Avatars" paper. This code is for the part of the paper describing video-based avatars.

NeuralTextures This is repository with inference code for paper "StylePeople: A Generative Model of Fullbody Human Avatars" (CVPR21). This code is for

Visual Understanding Lab @ Samsung AI Center Moscow 18 Oct 6, 2022
This is the official source code for SLATE. We provide the code for the model, the training code, and a dataset loader for the 3D Shapes dataset. This code is implemented in Pytorch.

SLATE This is the official source code for SLATE. We provide the code for the model, the training code and a dataset loader for the 3D Shapes dataset.

Gautam Singh 66 Dec 26, 2022
Code for paper ECCV 2020 paper: Who Left the Dogs Out? 3D Animal Reconstruction with Expectation Maximization in the Loop.

Who Left the Dogs Out? Evaluation and demo code for our ECCV 2020 paper: Who Left the Dogs Out? 3D Animal Reconstruction with Expectation Maximization

Benjamin Biggs 29 Dec 28, 2022
TensorFlow code for the neural network presented in the paper: "Structural Language Models of Code" (ICML'2020)

SLM: Structural Language Models of Code This is an official implementation of the model described in: "Structural Language Models of Code" [PDF] To ap

null 73 Nov 6, 2022
Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

CoProtector Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

Zhensu Sun 1 Oct 26, 2021
Code to use Augmented Shapiro Wilks Stopping, as well as code for the paper "Statistically Signifigant Stopping of Neural Network Training"

This codebase is being actively maintained, please create and issue if you have issues using it Basics All data files are included under losses and ea

J K Terry 32 Nov 9, 2021
Code for our method RePRI for Few-Shot Segmentation. Paper at http://arxiv.org/abs/2012.06166

Region Proportion Regularized Inference (RePRI) for Few-Shot Segmentation In this repo, we provide the code for our paper : "Few-Shot Segmentation Wit

Malik Boudiaf 138 Dec 12, 2022
Code for ACM MM 2020 paper "NOH-NMS: Improving Pedestrian Detection by Nearby Objects Hallucination"

NOH-NMS: Improving Pedestrian Detection by Nearby Objects Hallucination The offical implementation for the "NOH-NMS: Improving Pedestrian Detection by

Tencent YouTu Research 64 Nov 11, 2022
Official TensorFlow code for the forthcoming paper

~ Efficient-CapsNet ~ Are you tired of over inflated and overused convolutional neural networks? You're right! It's time for CAPSULES :)

Vittorio Mazzia 203 Jan 8, 2023
This is the code for the paper "Contrastive Clustering" (AAAI 2021)

Contrastive Clustering (CC) This is the code for the paper "Contrastive Clustering" (AAAI 2021) Dependency python>=3.7 pytorch>=1.6.0 torchvision>=0.8

Yunfan Li 210 Dec 30, 2022
Code for the paper Learning the Predictability of the Future

Learning the Predictability of the Future Code from the paper Learning the Predictability of the Future. Website of the project in hyperfuture.cs.colu

Computer Vision Lab at Columbia University 139 Nov 18, 2022
PyTorch code for the paper: FeatMatch: Feature-Based Augmentation for Semi-Supervised Learning

FeatMatch: Feature-Based Augmentation for Semi-Supervised Learning This is the PyTorch implementation of our paper: FeatMatch: Feature-Based Augmentat

null 43 Nov 19, 2022
Code for the paper A Theoretical Analysis of the Repetition Problem in Text Generation

A Theoretical Analysis of the Repetition Problem in Text Generation This repository share the code for the paper "A Theoretical Analysis of the Repeti

Zihao Fu 37 Nov 21, 2022
Code for our ICASSP 2021 paper: SA-Net: Shuffle Attention for Deep Convolutional Neural Networks

SA-Net: Shuffle Attention for Deep Convolutional Neural Networks (paper) By Qing-Long Zhang and Yu-Bin Yang [State Key Laboratory for Novel Software T

Qing-Long Zhang 199 Jan 8, 2023
Open source repository for the code accompanying the paper 'Non-Rigid Neural Radiance Fields Reconstruction and Novel View Synthesis of a Deforming Scene from Monocular Video'.

Non-Rigid Neural Radiance Fields This is the official repository for the project "Non-Rigid Neural Radiance Fields: Reconstruction and Novel View Synt

Facebook Research 296 Dec 29, 2022
Code for the Shortformer model, from the paper by Ofir Press, Noah A. Smith and Mike Lewis.

Shortformer This repository contains the code and the final checkpoint of the Shortformer model. This file explains how to run our experiments on the

Ofir Press 138 Apr 15, 2022
PyTorch code for ICLR 2021 paper Unbiased Teacher for Semi-Supervised Object Detection

Unbiased Teacher for Semi-Supervised Object Detection This is the PyTorch implementation of our paper: Unbiased Teacher for Semi-Supervised Object Detection

Facebook Research 366 Dec 28, 2022
Official code for paper "Optimization for Oriented Object Detection via Representation Invariance Loss".

Optimization for Oriented Object Detection via Representation Invariance Loss By Qi Ming, Zhiqiang Zhou, Lingjuan Miao, Xue Yang, and Yunpeng Dong. Th

ming71 56 Nov 28, 2022
Code for our CVPR 2021 paper "MetaCam+DSCE"

Joint Noise-Tolerant Learning and Meta Camera Shift Adaptation for Unsupervised Person Re-Identification (CVPR'21) Introduction Code for our CVPR 2021

FlyingRoastDuck 59 Oct 31, 2022