code: public void setLossVariables(String... lossVariableNames){
          this.lossVariables.clear();
          for(String s : lossVariableNames){
              addLossVariable(s);
          }
          //After changing loss function variables, we (probably) need to recreate gradient function - as gradient
          // function is defined with respect to specific loss function variables
          sameDiffFunctionInstances.remove("grad");
      }
docs: Clear/remove any existing loss variables, and set the loss variables to the specified variable names.<br>
  See {@link #addLossVariable(String)} for more details
  @param lossVariableNames Names of variables to be loss function variables