From 6657dd9ef3252a6c8a4ff316c7f7cedf06b35f02 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Mon, 29 Nov 2021 17:42:15 +0530 Subject: [PATCH 01/14] codec needs to be defined - put a placeholder for now --- src/features/speciesfeature.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/features/speciesfeature.jl b/src/features/speciesfeature.jl index fa88872f..7816eb24 100644 --- a/src/features/speciesfeature.jl +++ b/src/features/speciesfeature.jl @@ -48,6 +48,7 @@ function SpeciesFeatureDescriptor(name::String) else # TODO: figure out default binning situation for continuous-valued SFD's #codec = OneHotOneCold(false, ) + codec = DirectCodec(1) end SpeciesFeatureDescriptor{info[:A],typeof(codec)}( name, From 63546101200cd3f10a90a9f8126f5ca9bda54032 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Mon, 29 Nov 2021 17:42:34 +0530 Subject: [PATCH 02/14] initial skeleton --- src/featurizations/weavefeaturization.jl | 60 +++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/src/featurizations/weavefeaturization.jl b/src/featurizations/weavefeaturization.jl index 8fe418b3..5278f359 100644 --- a/src/featurizations/weavefeaturization.jl +++ b/src/featurizations/weavefeaturization.jl @@ -6,9 +6,67 @@ using ..ChemistryFeaturization.FeatureDescriptor: struct WeaveFeaturization <: AbstractFeaturization atom_features::Vector{<:AbstractAtomFeatureDescriptor} + bond_features::Vector{<:BondFeatureDescriptor} pair_features::Vector{<:AbstractPairFeatureDescriptor} end +function WeaveFeaturization(default_atom_feature_list = ["symbol", + "degree", + "implicit_valence", + "formal_charge", + "radical_electrons", + "hybridization", + "isaromatic", + "total_H_num"], + default_bond_feature_list = ["bondorder", "isaromaticbond", "isringbond"]) + species_feats = intersect(default_atom_feature_list, Utils.SpeciesFeatureUtils.sfd_names_props) + atoms = SpeciesFeatureDescriptor.(species_feats) + bonds = BondFeatureDescriptor.(default_bond_feature_list) + WeaveFeaturization(atoms, bonds, pairs) +end + function encodable_elements(fzn::WeaveFeaturization) - # TODO: implement me! + intersect([encodable_elements(f) for f in fzn.atom_features]...), + intersect([encodable_elements(f) for f in fzn.bond_features]...), + intersect([encodable_elements(f) for f in fzn.pair_features]...) +end + +# function encode(fzn::GraphNodeFeaturization, ag::AtomGraph) +# encoded = reduce(vcat, map((x) -> encode(x, ag), fzn.features)) +# return encoded +# end + +function atom_features() end + +# weave_mols = weave_featurize(smiles[Int((b_i-1)*batch_size+1):Int(b_i*batch_size)], +# atom_feature_list = atom_feature_list, +# bond_feature_list = bond_feature_list) +# y_batch = [Y[Int((b_i-1)*batch_size+1):Int(b_i*batch_size)]] +# default_atom_feature_list = ["symbol","degree","implicit_valence","formal_charge","radical_electrons","hybridization","aromaticity","total_H_num" ] +# default_bond_feature_list = ["bond_type","isConjugated","isInring"] + +function encode(fzn::WeaveFeaturization, ag::AtomGraph; atom_feature_kwargs = (;), + bond_feature_kwargs = (;), + pair_feature_kwargs = (;)) + af = mapreduce(x -> encode(x, ag, atom_feature_kwargs...), vcat, fzn.atom_features) + bf = mapreduce(x -> encode(x, ag, bond_feature_kwargs...), vcat, fzn.bond_features) + pf = mapreduce(x -> encode(x, ag, pair_feature_kwargs...), vcat, fzn.pair_features) + vcat(af, bf, pf) +end + +# function decode(fzn::GraphNodeFeaturization, encoded::Matrix{<:Real}) +# num_atoms = size(encoded, 2) +# nbins = [output_shape(f) for f in fzn.features] +# local decoded = Dict{Integer,Dict{String,Any}}() +# for i = 1:num_atoms +# #println("atom $i") +# chunks = chunk_vec(encoded[:, i], nbins) +# decoded[i] = Dict{String,Any}() +# for (chunk, f) in zip(chunks, fzn.features) +# #println(" $(f.name): $(decode(f, chunk))") +# decoded[i][f.name] = decode(f, chunk) +# end +# end +# return decoded +# end From cc64d434a7a4769206ae71c9dafd8f9f6f27abf2 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Mon, 29 Nov 2021 17:42:50 +0530 Subject: [PATCH 03/14] missing mappings --- src/utils/speciesfeature_utils.jl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/utils/speciesfeature_utils.jl b/src/utils/speciesfeature_utils.jl index 49c35fb9..2ba67c62 100644 --- a/src/utils/speciesfeature_utils.jl +++ b/src/utils/speciesfeature_utils.jl @@ -50,6 +50,34 @@ const sfd_names_props = Dict( :encodable_elements => mg_elements, :possible_vals => [0, 1, 2], # also not certain this is correct ), + "degree" => Dict( + :A => GraphMol, + :compute_f => nodedegree, + :categorical => false, + :encodable_elements => mg_elements, + :codec => DirectCodec, + ), + "radical_electrons" => Dict( + :A => GraphMol, + :compute_f => multiplicity, + :categorical => true, + :encodable_elements => mg_elements, + :possible_vals => [1, 2, 3], + ), + "implicit_valence" => Dict( + :A => GraphMol, + :compute_f => implicithconnected, + :categorical => false, + :encodable_elements => mg_elements, + :codec => DirectCodec, + ), + "total_H_num" => Dict( + :A => GraphMol, + :compute_f => hydrogenconnected, + :categorical => false, + :encodable_elements => mg_elements, + :codec => DirectCodec, + ), ) end From 3a628fd6583e4be897bbcaa9bfad6bc0fb0f8bbc Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Mon, 29 Nov 2021 17:55:32 +0530 Subject: [PATCH 04/14] rm total_H_num --- src/utils/speciesfeature_utils.jl | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/utils/speciesfeature_utils.jl b/src/utils/speciesfeature_utils.jl index 2ba67c62..071293fe 100644 --- a/src/utils/speciesfeature_utils.jl +++ b/src/utils/speciesfeature_utils.jl @@ -71,13 +71,6 @@ const sfd_names_props = Dict( :encodable_elements => mg_elements, :codec => DirectCodec, ), - "total_H_num" => Dict( - :A => GraphMol, - :compute_f => hydrogenconnected, - :categorical => false, - :encodable_elements => mg_elements, - :codec => DirectCodec, - ), ) end From faa856f286969be34dfa30e09e74dfa11b91c35c Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Mon, 29 Nov 2021 17:58:21 +0530 Subject: [PATCH 05/14] add charge feature --- src/utils/speciesfeature_utils.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils/speciesfeature_utils.jl b/src/utils/speciesfeature_utils.jl index 071293fe..989b6325 100644 --- a/src/utils/speciesfeature_utils.jl +++ b/src/utils/speciesfeature_utils.jl @@ -71,6 +71,13 @@ const sfd_names_props = Dict( :encodable_elements => mg_elements, :codec => DirectCodec, ), + "charge" => Dict( + :A => GraphMol, + :compute_f => charge, + :categorical => false, + :encodable_elements => mg_elements, + :codec => DirectCodec, + ), ) end From 84c8c3f1866b5f510981cde0f11ba34c2bd1e18f Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Mon, 29 Nov 2021 19:04:09 +0530 Subject: [PATCH 06/14] make the labels look closer to MG --- src/featurizations/weavefeaturization.jl | 6 +++--- src/utils/speciesfeature_utils.jl | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/featurizations/weavefeaturization.jl b/src/featurizations/weavefeaturization.jl index 5278f359..0d0da20c 100644 --- a/src/featurizations/weavefeaturization.jl +++ b/src/featurizations/weavefeaturization.jl @@ -12,12 +12,12 @@ end function WeaveFeaturization(default_atom_feature_list = ["symbol", "degree", - "implicit_valence", - "formal_charge", + "implicithconnected", + "charge", "radical_electrons", "hybridization", "isaromatic", - "total_H_num"], + "hydrogenconnected"], default_bond_feature_list = ["bondorder", "isaromaticbond", "isringbond"]) species_feats = intersect(default_atom_feature_list, Utils.SpeciesFeatureUtils.sfd_names_props) atoms = SpeciesFeatureDescriptor.(species_feats) diff --git a/src/utils/speciesfeature_utils.jl b/src/utils/speciesfeature_utils.jl index 989b6325..8419e96d 100644 --- a/src/utils/speciesfeature_utils.jl +++ b/src/utils/speciesfeature_utils.jl @@ -64,7 +64,14 @@ const sfd_names_props = Dict( :encodable_elements => mg_elements, :possible_vals => [1, 2, 3], ), - "implicit_valence" => Dict( + "multiplicity" => Dict( + :A => GraphMol, + :compute_f => multiplicity, + :categorical => true, + :encodable_elements => mg_elements, + :possible_vals => [1, 2, 3], + ), + "implicithconnected" => Dict( :A => GraphMol, :compute_f => implicithconnected, :categorical => false, From d6dd2532075928b0d69c3e94a3dc90c7ef3c1c27 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Thu, 2 Dec 2021 01:15:47 +0530 Subject: [PATCH 07/14] fix imports --- src/utils/speciesfeature_utils.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/speciesfeature_utils.jl b/src/utils/speciesfeature_utils.jl index 8419e96d..335f3de5 100644 --- a/src/utils/speciesfeature_utils.jl +++ b/src/utils/speciesfeature_utils.jl @@ -1,5 +1,7 @@ module SpeciesFeatureUtils +using ...ChemistryFeaturization.Codec: DirectCodec + using MolecularGraph # some convenience SFD constructors mapping names of species features to MolecularGraph functions... From 0ffef33bef60509895b09db28a76047537484b80 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Thu, 2 Dec 2021 01:16:03 +0530 Subject: [PATCH 08/14] cleanups --- src/featurizations/weavefeaturization.jl | 72 +++++++++++++++++++++--- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/src/featurizations/weavefeaturization.jl b/src/featurizations/weavefeaturization.jl index 0d0da20c..e53fea16 100644 --- a/src/featurizations/weavefeaturization.jl +++ b/src/featurizations/weavefeaturization.jl @@ -3,6 +3,8 @@ using ..ChemistryFeaturization.AbstractType: AbstractFeaturization using ..ChemistryFeaturization.FeatureDescriptor: AbstractAtomFeatureDescriptor, AbstractPairFeatureDescriptor +using ..ChemistryFeaturization.Codec: DirectCodec +using ..ChemistryFeaturization.Utils struct WeaveFeaturization <: AbstractFeaturization atom_features::Vector{<:AbstractAtomFeatureDescriptor} @@ -19,10 +21,12 @@ function WeaveFeaturization(default_atom_feature_list = ["symbol", "isaromatic", "hydrogenconnected"], default_bond_feature_list = ["bondorder", "isaromaticbond", "isringbond"]) - species_feats = intersect(default_atom_feature_list, Utils.SpeciesFeatureUtils.sfd_names_props) + species_feats = intersect(keys(Utils.SpeciesFeatureUtils.sfd_names_props), default_atom_feature_list) + atoms = SpeciesFeatureDescriptor.(species_feats) bonds = BondFeatureDescriptor.(default_bond_feature_list) - WeaveFeaturization(atoms, bonds, pairs) + # pairs = PairFeatureDescriptor.(default_atom_feature_list) + WeaveFeaturization(atoms, bonds, bonds) end function encodable_elements(fzn::WeaveFeaturization) @@ -36,9 +40,57 @@ end # return encoded # end -function atom_features() +function atom_features(feat, mol; kw...) + end +const DEEPCHEM_ATOM_SYMBOLS = [ + "C", + "N", + "O", + "S", + "F", + "Si", + "P", + "Cl", + "Br", + "Mg", + "Na", + "Ca", + "Fe", + "As", + "Al", + "I", + "B", + "V", + "K", + "Tl", + "Yb", + "Sb", + "Sn", + "Ag", + "Pd", + "Co", + "Se", + "Ti", + "Zn", + "H", # H? + "Li", + "Ge", + "Cu", + "Au", + "Ni", + "Cd", + "In", + "Mn", + "Zr", + "Cr", + "Pt", + "Hg", + "Pb", + "Unknown" + ] + # weave_mols = weave_featurize(smiles[Int((b_i-1)*batch_size+1):Int(b_i*batch_size)], # atom_feature_list = atom_feature_list, # bond_feature_list = bond_feature_list) @@ -46,13 +98,19 @@ end # default_atom_feature_list = ["symbol","degree","implicit_valence","formal_charge","radical_electrons","hybridization","aromaticity","total_H_num" ] # default_bond_feature_list = ["bond_type","isConjugated","isInring"] +struct FeaturizedWeave + atom_features + bond_features + pair_features +end + function encode(fzn::WeaveFeaturization, ag::AtomGraph; atom_feature_kwargs = (;), bond_feature_kwargs = (;), pair_feature_kwargs = (;)) - af = mapreduce(x -> encode(x, ag, atom_feature_kwargs...), vcat, fzn.atom_features) - bf = mapreduce(x -> encode(x, ag, bond_feature_kwargs...), vcat, fzn.bond_features) - pf = mapreduce(x -> encode(x, ag, pair_feature_kwargs...), vcat, fzn.pair_features) - vcat(af, bf, pf) + af = map(x -> encode(x, ag, atom_feature_kwargs...), fzn.atom_features) + bf = map(x -> encode(x, ag, bond_feature_kwargs...), fzn.bond_features) + pf = map(x -> encode(x, ag, pair_feature_kwargs...), fzn.pair_features) + FeaturizedWeave(af, bf, pf) end # function decode(fzn::GraphNodeFeaturization, encoded::Matrix{<:Real}) From ebce5ba6d0de9322953df2134499bb8acc6cc628 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Thu, 2 Dec 2021 01:28:03 +0530 Subject: [PATCH 09/14] add featurized weave --- src/featurizations/weavefeaturization.jl | 30 +++--------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/src/featurizations/weavefeaturization.jl b/src/featurizations/weavefeaturization.jl index e53fea16..7e5d9bdf 100644 --- a/src/featurizations/weavefeaturization.jl +++ b/src/featurizations/weavefeaturization.jl @@ -35,11 +35,6 @@ function encodable_elements(fzn::WeaveFeaturization) intersect([encodable_elements(f) for f in fzn.pair_features]...) end -# function encode(fzn::GraphNodeFeaturization, ag::AtomGraph) -# encoded = reduce(vcat, map((x) -> encode(x, ag), fzn.features)) -# return encoded -# end - function atom_features(feat, mol; kw...) end @@ -91,10 +86,6 @@ const DEEPCHEM_ATOM_SYMBOLS = [ "Unknown" ] -# weave_mols = weave_featurize(smiles[Int((b_i-1)*batch_size+1):Int(b_i*batch_size)], -# atom_feature_list = atom_feature_list, -# bond_feature_list = bond_feature_list) -# y_batch = [Y[Int((b_i-1)*batch_size+1):Int(b_i*batch_size)]] # default_atom_feature_list = ["symbol","degree","implicit_valence","formal_charge","radical_electrons","hybridization","aromaticity","total_H_num" ] # default_bond_feature_list = ["bond_type","isConjugated","isInring"] @@ -107,24 +98,9 @@ end function encode(fzn::WeaveFeaturization, ag::AtomGraph; atom_feature_kwargs = (;), bond_feature_kwargs = (;), pair_feature_kwargs = (;)) - af = map(x -> encode(x, ag, atom_feature_kwargs...), fzn.atom_features) - bf = map(x -> encode(x, ag, bond_feature_kwargs...), fzn.bond_features) - pf = map(x -> encode(x, ag, pair_feature_kwargs...), fzn.pair_features) + af = mapreduce(x -> encode(x, ag, atom_feature_kwargs...), vcat, fzn.atom_features) + bf = cat(map(x -> encode(x, ag, bond_feature_kwargs...), fzn.bond_features)..., dims = 3) + pf = cat(map(x -> encode(x, ag, pair_feature_kwargs...), fzn.pair_features)..., dims = 3) FeaturizedWeave(af, bf, pf) end -# function decode(fzn::GraphNodeFeaturization, encoded::Matrix{<:Real}) -# num_atoms = size(encoded, 2) -# nbins = [output_shape(f) for f in fzn.features] -# local decoded = Dict{Integer,Dict{String,Any}}() -# for i = 1:num_atoms -# #println("atom $i") -# chunks = chunk_vec(encoded[:, i], nbins) -# decoded[i] = Dict{String,Any}() -# for (chunk, f) in zip(chunks, fzn.features) -# #println(" $(f.name): $(decode(f, chunk))") -# decoded[i][f.name] = decode(f, chunk) -# end -# end -# return decoded -# end From a2528e25094580b6ac50ad2497c993f494e27f85 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Wed, 8 Dec 2021 17:37:59 +0530 Subject: [PATCH 10/14] separate element and species feats --- src/ChemistryFeaturization.jl | 4 +-- src/featurizations/weavefeaturization.jl | 39 ++++++++++++++---------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/ChemistryFeaturization.jl b/src/ChemistryFeaturization.jl index ada36f69..ccbcd335 100644 --- a/src/ChemistryFeaturization.jl +++ b/src/ChemistryFeaturization.jl @@ -34,8 +34,8 @@ export output_shape, get_value include("featurizations/featurizations.jl") export Featurization -using .Featurization: GraphNodeFeaturization, encode -export GraphNodeFeaturization, encode +using .Featurization: GraphNodeFeaturization, WeaveFeaturization, encode +export GraphNodeFeaturization, WeaveFeaturization, encode export encodable_elements, decode diff --git a/src/featurizations/weavefeaturization.jl b/src/featurizations/weavefeaturization.jl index 7e5d9bdf..de5c8473 100644 --- a/src/featurizations/weavefeaturization.jl +++ b/src/featurizations/weavefeaturization.jl @@ -7,26 +7,26 @@ using ..ChemistryFeaturization.Codec: DirectCodec using ..ChemistryFeaturization.Utils struct WeaveFeaturization <: AbstractFeaturization + element_features::Vector{<:AbstractAtomFeatureDescriptor} atom_features::Vector{<:AbstractAtomFeatureDescriptor} bond_features::Vector{<:BondFeatureDescriptor} pair_features::Vector{<:AbstractPairFeatureDescriptor} end -function WeaveFeaturization(default_atom_feature_list = ["symbol", - "degree", - "implicithconnected", - "charge", - "radical_electrons", - "hybridization", - "isaromatic", - "hydrogenconnected"], - default_bond_feature_list = ["bondorder", "isaromaticbond", "isringbond"]) - species_feats = intersect(keys(Utils.SpeciesFeatureUtils.sfd_names_props), default_atom_feature_list) - - atoms = SpeciesFeatureDescriptor.(species_feats) - bonds = BondFeatureDescriptor.(default_bond_feature_list) +function WeaveFeaturization(element_feature_list = ["Atomic no"], + species_feature_list = ["degree", + "implicithconnected", + "charge", + "radical_electrons", + "hybridization", + "isaromatic", + "hydrogenconnected"], + bond_feature_list = ["bondorder", "isaromaticbond", "isringbond"]) + elements = ElementFeatureDescriptor.(element_feature_list) + species = SpeciesFeatureDescriptor.(species_feature_list) + bonds = BondFeatureDescriptor.(bond_feature_list) # pairs = PairFeatureDescriptor.(default_atom_feature_list) - WeaveFeaturization(atoms, bonds, bonds) + WeaveFeaturization(elements, species, bonds, bonds) end function encodable_elements(fzn::WeaveFeaturization) @@ -39,6 +39,10 @@ function atom_features(feat, mol; kw...) end +function pair_features(feat, mol; kw...) + +end + const DEEPCHEM_ATOM_SYMBOLS = [ "C", "N", @@ -98,9 +102,12 @@ end function encode(fzn::WeaveFeaturization, ag::AtomGraph; atom_feature_kwargs = (;), bond_feature_kwargs = (;), pair_feature_kwargs = (;)) - af = mapreduce(x -> encode(x, ag, atom_feature_kwargs...), vcat, fzn.atom_features) + sf = mapreduce(x -> encode(x, ag, atom_feature_kwargs...), vcat, fzn.atom_features) + ef = mapreduce(x -> encode(x, ag, atom_feature_kwargs...), vcat, fzn.element_features) + atom_and_elements = vcat(sf, ef) bf = cat(map(x -> encode(x, ag, bond_feature_kwargs...), fzn.bond_features)..., dims = 3) pf = cat(map(x -> encode(x, ag, pair_feature_kwargs...), fzn.pair_features)..., dims = 3) - FeaturizedWeave(af, bf, pf) + # Return FeaturizedAtoms here + FeaturizedWeave(atom_and_elements, bf, pf) end From c45ab1e62923ccc06c564440bd842e402e12f790 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Thu, 9 Dec 2021 23:06:36 +0530 Subject: [PATCH 11/14] add show methods --- src/featurizations/weavefeaturization.jl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/featurizations/weavefeaturization.jl b/src/featurizations/weavefeaturization.jl index de5c8473..d1200a4f 100644 --- a/src/featurizations/weavefeaturization.jl +++ b/src/featurizations/weavefeaturization.jl @@ -29,6 +29,8 @@ function WeaveFeaturization(element_feature_list = ["Atomic no"], WeaveFeaturization(elements, species, bonds, bonds) end +WeaveFeaturization(; kw...) = WeaveFeaturization(values(kw)...) + function encodable_elements(fzn::WeaveFeaturization) intersect([encodable_elements(f) for f in fzn.atom_features]...), intersect([encodable_elements(f) for f in fzn.bond_features]...), @@ -108,6 +110,15 @@ function encode(fzn::WeaveFeaturization, ag::AtomGraph; atom_feature_kwargs = (; bf = cat(map(x -> encode(x, ag, bond_feature_kwargs...), fzn.bond_features)..., dims = 3) pf = cat(map(x -> encode(x, ag, pair_feature_kwargs...), fzn.pair_features)..., dims = 3) # Return FeaturizedAtoms here - FeaturizedWeave(atom_and_elements, bf, pf) + atom_and_elements, vcat(bf, pf) + # FeaturizedWeave(atom_and_elements, bf, pf) end +function Base.show(io::IO, fzn::WeaveFeaturization) + println(io, "WeaveFeaturization(") + println(io) + println(io, " Species Features: $(map(x -> x.name, fzn.element_features))") + println(io, " Atom Features: $(map(x -> x.name, fzn.atom_features))") + println(io, " Bond Features: $(map(x -> x.name, fzn.bond_features))") + println(io, ")") +end From 7b7aec0b62e86bbcb58ec26e07e6ef0b1a09ccb6 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Wed, 15 Dec 2021 12:29:57 +0530 Subject: [PATCH 12/14] make degree categorical --- src/utils/speciesfeature_utils.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/speciesfeature_utils.jl b/src/utils/speciesfeature_utils.jl index 335f3de5..4a54ae3f 100644 --- a/src/utils/speciesfeature_utils.jl +++ b/src/utils/speciesfeature_utils.jl @@ -55,9 +55,9 @@ const sfd_names_props = Dict( "degree" => Dict( :A => GraphMol, :compute_f => nodedegree, - :categorical => false, + :categorical => true, :encodable_elements => mg_elements, - :codec => DirectCodec, + :possible_vals => collect(0:10), ), "radical_electrons" => Dict( :A => GraphMol, From 987bcdc6321ab9a01e95f89b3394600223a35ad3 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Thu, 16 Dec 2021 23:27:46 +0530 Subject: [PATCH 13/14] fixes --- src/featurizations/weavefeaturization.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/featurizations/weavefeaturization.jl b/src/featurizations/weavefeaturization.jl index d1200a4f..2eb4d147 100644 --- a/src/featurizations/weavefeaturization.jl +++ b/src/featurizations/weavefeaturization.jl @@ -41,6 +41,10 @@ function atom_features(feat, mol; kw...) end +function bond_feature(bond, mol; kw...) + +end + function pair_features(feat, mol; kw...) end From af601eaabb230dd8a95128c950174244b02cad10 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Tue, 4 Jan 2022 23:28:59 +0530 Subject: [PATCH 14/14] clean up printing --- src/featurizations/weavefeaturization.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/featurizations/weavefeaturization.jl b/src/featurizations/weavefeaturization.jl index 2eb4d147..add48c9d 100644 --- a/src/featurizations/weavefeaturization.jl +++ b/src/featurizations/weavefeaturization.jl @@ -120,7 +120,6 @@ end function Base.show(io::IO, fzn::WeaveFeaturization) println(io, "WeaveFeaturization(") - println(io) println(io, " Species Features: $(map(x -> x.name, fzn.element_features))") println(io, " Atom Features: $(map(x -> x.name, fzn.atom_features))") println(io, " Bond Features: $(map(x -> x.name, fzn.bond_features))")