[MGNLPER-106] Cleanup the ranking workspace when changing the neural network size Created: 15/Apr/19  Updated: 22/Sep/22  Resolved: 22/Sep/22

Status: Closed
Project: Periscope
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: Simon Lutz Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLPER-107 DOC: Lang. review of Periscope Result... Closed
supersession
is superseded by MGNLPER-154 Remove ranking from bundle Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Epic Link: Periscope improvements
Team: AuthorX

 Description   

When changing the outputUnits value (for instance from default 10000 to 1000) in order to reduce NN size, if one doesn't cleanup the ranking workspace, an exception similar to the following will show in the logs upon selecting one search result.

This is because the neural network loaded in memory was created with the previous configuration which doesn't match the new one.

2019-03-21 12:32:53,293 ERROR gnolia.periscope.rank.ml.NeuralNetworkResultRanker: Failed to train ranking neural network
*java.lang.IllegalArgumentException: Labels and preOutput must have equal shapes: got shapes [1, 10000] vs [1, 1000]*
	at org.nd4j.base.Preconditions.throwEx(Preconditions.java:636) ~[nd4j-common-1.0.0-beta3.jar:?]
	at org.nd4j.linalg.lossfunctions.impl.LossMCXENT.computeGradient(LossMCXENT.java:155) ~[nd4j-api-1.0.0-beta3.jar:1.0.0-beta3]

Generated at Mon Feb 12 10:28:47 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.