Mediate (or Bend the Rules)
June 1, 2015 · View on GitHub
The dp library can be very rigid in how the interactions between different objects are regulated (e.g. how DataSet, Propagator, Module and Criterion all work together like clockwork). Yet when doing research and development in the field of deep learning, we often need to build models that require non-standard interactions. While the library cannot provide rigid interaction patterns for every research use case, it provides different flexible alternatives. In this section we examine the Mediator singleton and its supporting classes that implement the Publish–subscribe pattern:
- Mediator : singleton that implements listen-notify pattern;
- Channel : can be published and subscribed to;
- Subscriber : encapsulates a listening object and callback method;