Major Features and Improvements
- Add
paramsas an optional third argument to theembedding_fnargument of
nsl.estimator.add_graph_regularization. This is similar to theparams
argument of an Estimator'smodel_fn, which allows users to pass arbitrary
states through. Adding this as an argument toembedding_fnwill allow
users to access that state in the implementation ofembedding_fn. - Both
nsl.keras.AdversarialRegularizationand
nsl.keras.GraphRegularizationnow support thesavemethod which will
save the base model. nsl.keras.AdversarialRegularizationnow supports atf.keras.Sequential
base model with atf.keras.layers.DenseFeatureslayer.nsl.configs.AdvNeighborConfighas a new fieldrandom_init. If set to
True, a random perturbation will be performed before FGSM/PGD steps.nsl.lib.gen_adv_neighbornow has a new parameteruse_while_loop. If set
toTrue, the PGD steps are done in atf.while_loopwhich is potentially
more memory efficient but has some restrictions.- New library functions:
nsl.lib.random_in_norm_ballfor generating random tensors in a norm
ball.nsl.lib.project_to_ballfor projecting tensors onto a norm ball.
Bug Fixes and Other Changes
- Dropped Python 2 support (which was deprecated 2+ years ago).
nsl.keras.AdversarialRegularizationandnsl.lib.gen_adv_neighborwill
not attempt to calculate gradients for tensors with a non-differentiable
dtype. This doesn’t change the functionality, but only suppresses excess
warnings.- Both
estimator/adversarial_regularization.pyand
estimator/graph_regularization.pyexplicitly importestimatorfrom
tensorflowas a separate import instead of accessing it viatf.estimator
and depend on the tensorflowestimatortarget. - The new top-level
workshopsdirectory contains presentation materials from
tutorials we organized on NSL at KDD 2020, WSDM 2021, and WebConf 2021. - The new
usage.mdpage describes featured usage of NSL, external talks,
blog posts, media coverage, and more. - End-to-end examples under the
examplesdirectory:- New examples about graph neural network modules with graph-regularizer
and graph convolution. - New README file providing an overview of the examples.
- New examples about graph neural network modules with graph-regularizer
- New tutorial examples under the
examples/notebooksdirectory:- Graph regularization for image classification using synthesized graphs
- Adversarial Learning: Building Robust Image Classifiers
- Saving and loading NSL models
Thanks to our Contributors
This release contains contributions from many people at Google Research and from
TF community members: @angela-wang1 , @dipanjanS, @joshchang1112, @SamuelMarks,
@sayakpaul, @wangbingnan136, @zoeyz101