Shortcuts

PrepareProtoBeforeValLoopHook

class mmpretrain.engine.hooks.PrepareProtoBeforeValLoopHook[源代码]

The hook to prepare the prototype in retrievers.

Since the encoders of the retriever changes during training, the prototype changes accordingly. So the prototype_vecs needs to be regenerated before validation loop.