Training neural models with structured signals.
params
as an optional third argument to the embedding_fn
argument of
nsl.estimator.add_graph_regularization
. This is similar to the params
argument of an Estimator's model_fn
, which allows users to pass arbitrary
states through. Adding this as an argument to embedding_fn
will allow
users to access that state in the implementation of embedding_fn
.nsl.keras.AdversarialRegularization
and
nsl.keras.GraphRegularization
now support the save
method which will
save the base model.nsl.keras.AdversarialRegularization
now supports a tf.keras.Sequential
base model with a tf.keras.layers.DenseFeatures
layer.nsl.configs.AdvNeighborConfig
has a new field random_init
. If set to
True
, a random perturbation will be performed before FGSM/PGD steps.nsl.lib.gen_adv_neighbor
now has a new parameter use_while_loop
. If set
to True
, the PGD steps are done in a tf.while_loop
which is potentially
more memory efficient but has some restrictions.nsl.lib.random_in_norm_ball
for generating random tensors in a norm
ball.nsl.lib.project_to_ball
for projecting tensors onto a norm ball.nsl.keras.AdversarialRegularization
and nsl.lib.gen_adv_neighbor
will
not attempt to calculate gradients for tensors with a non-differentiable
dtype
. This doesn’t change the functionality, but only suppresses excess
warnings.estimator/adversarial_regularization.py
and
estimator/graph_regularization.py
explicitly import estimator
from
tensorflow
as a separate import instead of accessing it via tf.estimator
and depend on the tensorflow estimator
target.workshops
directory contains presentation materials from
tutorials we organized on NSL at KDD 2020, WSDM 2021, and WebConf 2021.usage.md
page describes featured usage of NSL, external talks,
blog posts, media coverage, and more.examples
directory:
examples/notebooks
directory:
This release contains contributions from many people at Google Research and from TF community members: @angela-wang1 , @dipanjanS, @joshchang1112, @SamuelMarks, @sayakpaul, @wangbingnan136, @zoeyz101
None.
lsh_rounds
when lsh_splits
< 1. By
default, the prior version of the graph builder would repeat the work twice
by default. In addition, the default value for lsh_rounds
has been changed
from 2 to 1.This release contains contributions from many people at Google.
nsl.configs.GraphBuilderConfig
class was
introduced, as well as a new nsl.tools.build_graph_from_config
function.
The new parameters for controlling the LSH algorithm are named lsh_rounds
and lsh_splits
.nsl.tools.add_edge
to return a boolean result indicating if a new
edge was added or not; previously, this function was not returning any
value.nsl.tools.read_tsv_graph
that was incrementing the reported
edge count too often.nsl.estimator.add_adversarial_regularization
and
nsl.estimator.add_graph_regularization
so that the UPDATE_OPS
can be
triggered correctly.nsl.estimator.add_graph_regularization
and
nsl.estimator.add_adversarial_regularization
respectively.nsl.keras.GraphRegularization
and nsl.keras.AdversarialRegularization
respectively, to include scaled values for consistency with their respective
loss term contributions.This release contains contributions from many people at Google.
nsl.tools.build_graph(...)
to be more efficient and use far less
memory. In particular, the memory consumption is now proportional only to
the size of the input, not the size of the input plus the size of the
output. Since the size of the output can be quadratic in the size of the
input, this can lead to large memory savings. nsl.tools.build_graph(...)
now also produces a log message every 1M edges it writes to indicate
progress.nsl.lib.strip_neighbor_features
, a function to remove graph
neighbor features from a feature dictionary.keep_rank
from False
to True
as well as
flip its semantics in nsl.keras.layers.NeighborFeatures.call
and
nsl.utils.unpack_neighbor_features
.clip_value_min
and clip_value_max
in nsl.configs.AdvNeighborConfig
.nsl.lib.adversarial_neighbor.gen_adv_neighbor
API.nsl.AdvNeighborConfig.feature_mask
field.nsl.tools.build_graph
and
nsl.tools.pack_nbrs
utilities as binaries.nsl.lib.gen_adv_neighbor
.nsl.lib.maximize_within_unit_norm
.base_with_labels_in_features
to
nsl.keras.AdversarialRegularization
for passing label features to the base
model.nsl.keras.AdversarialRegularization
when used with a functional Keras base model.This release contains contributions from many people at Google as well as @mzahran001.
Introduces nsl.tools.build_graph
, a function for graph building.
Introduces nsl.tools.pack_nbrs
, a function to prepare input for
graph-based NSL.
Adds tf.estimator.Estimator
support for NSL. In particular, this release
introduces two new wrapper functions named
nsl.estimator.add_graph_regularization
and
nsl.estimator.add_adversarial_regularization
to wrap existing
tf.estimator.Estimator
-based models with NSL. These APIs are currently
supported only for TF 1.x.
Adds version information to the NSL package, which can be queried as
nsl.__version__
.
Fixes loss computation with Loss
objects in AdversarialRegularization
.
Adds a new parameter to nsl.keras.adversarial_loss
which can be used to
pass additional arguments to the model.
Fixes typos in documentation and notebooks.
Updates notebooks to use the release version of TF 2.0.
This release contains contributions from many people at Google.
Adds make_graph_reg_config
, a new API to help construct a nsl.configs.GraphRegConfig
object
Updates the package description on PyPI
Fixes metric computation with Metric
objects in AdversarialRegularization
Fixes typos in documentation and notebooks
This release contains contributions from many people at Google, as well as:
@joaogui1, @aspratyush.
Initial release of Neural Structured Learning.