Load a Bayesian network and return the probabilistic network object

@param netFile
@return
@throws ShanksException
963278
@SuppressWarnings("deprecation")
    public static ProbabilisticNetwork loadNetwork(File netFile)
            throws ShanksException {
        ProbabilisticNetwork net = null;
        BaseIO io = new NetIO();
        try {
            net = (ProbabilisticNetwork) io.load(netFile);
            net.compile();
        } catch (LoadException e) {
            throw new ShanksException(e);
        } catch (IOException e) {
            throw new ShanksException(e);
        } catch (Exception e) {
            throw new ShanksException(e);
        }
        return net;
    }
1265378
public static int getNode(BayesianReasonerShanksAgent agent, String nodeName)
            throws ShanksException {
        return ShanksAgentBayesianReasoningCapability.getNode(
                agent.getBayesianNetwork(), nodeName);
    }
757643
private void reconstituteNetwork(final File file) {

        BinaryProtoNetworkDescriptor inputProtoNetworkDesc =
                new BinaryProtoNetworkDescriptor(file);
        ProtoNetworkExternalizer pne = new BinaryProtoNetworkExternalizer();
        ProtoNetwork global = null;

        try {
            global = pne.readProtoNetwork(inputProtoNetworkDesc);
        } catch (ProtoNetworkError e) {
            error(e.getUserFacingMessage());
            final ExitCode ec = ExitCode.NO_GLOBAL_PROTO_NETWORK;
            exit(ec);
        }

        processNetwork(global);
    }
442367
public static MultiLayerNetwork loadCheckpointMLN(File rootDir, Checkpoint checkpoint) {
        return loadCheckpointMLN(rootDir, checkpoint.getCheckpointNum());
    }
356188
public void load(File mean, File std) throws IOException {
        this.mean = Nd4j.readBinary(mean);
        this.std = Nd4j.readBinary(std);
    }
1068020
public static void addEvidence(Network bn, String nodeName, String status)
            throws ShanksException {

        if (bn == null || nodeName == null || status == null) {
            throw new ShanksException("Null parameter in addEvidence method.");
        }
        try {
            if (!bn.isPropagatedEvidence(nodeName)) {
                if (bn.isRealEvidence(nodeName)) {
                    bn.clearEvidence(nodeName);
                }
                bn.setEvidence(nodeName, status);
                bn.updateBeliefs();
            }
        } catch (Exception e) {
            bn.updateBeliefs();
            HashMap<String, Float> belief = ShanksAgentBayesianReasoningCapability
                    .getNodeStatesHypotheses(bn, nodeName);

            String msg = e.getMessage() + " -> values for node: " + nodeName
                    + " -> ";
            boolean zeroBel = false;
            for (Entry<String, Float> entry : belief.entrySet()) {
                if (status.equals(entry.getKey()) && entry.getValue() == 0.0f) {
                    zeroBel = true;
                    // Impossible value calculated by inference (this is because the BN is a big shit...
                    // But it is not a real error...
                    break;
                }
                msg = msg + entry.getKey() + "-" + entry.getValue() + " ";
            }
            if (!zeroBel) {
                throw new ShanksException(msg);
            }
        }
    }
942175
public void loadModel(String modelfile) throws IOException,
			ClassNotFoundException {
		ObjectInputStream instream = new ObjectInputStream(new GZIPInputStream(
				new FileInputStream(modelfile)));
		factory = (AlphabetFactory) instream.readObject();
		models = (Linear[]) instream.readObject();
		instream.close();
		IFeatureAlphabet features = factory.DefaultFeatureAlphabet();
		features.setStopIncrement(true);
	}
1215487
def load(self, modelfile, layer=None):
        
        # read modelfile, convert JSON and load/update model
        self.param_file = modelfile
        self._load(layer)
        self._update(layer)
707537
public static HashMap<String, HashMap<String, Float>> getAllHypotheses(
            Network bn) throws ShanksException {
        HashMap<String, HashMap<String, Float>> result = new HashMap<String, HashMap<String, Float>>();
        for (int node : bn.getAllNodes()) {
            String nodeName = bn.getNodeName(node);
            HashMap<String, Float> hypotheses = ShanksAgentBayesianReasoningCapability
                    .getNodeStatesHypotheses(bn, nodeName);
            result.put(nodeName, hypotheses);
        }
        return result;
    }
267703
@SuppressWarnings("deprecation")
    public static void clearEvidences(ProbabilisticNetwork bn)
            throws ShanksException {
        try {
            bn.compile();
        } catch (Exception e) {
            throw new ShanksException(e);
        }
    }
64415
@Override
  public final Parameters load(final File configFile) throws IOException {
    final Loading loading = new Loading();
    loading.topLoad(configFile);
    return Parameters.fromMap(loading.ret);
  }
1269148
public static SimpleDataSet loadArffFile(File file) 
    {
        try
        {
            return loadArffFile(new FileReader(file));
        }
        catch (FileNotFoundException ex)
        {
            Logger.getLogger(ARFFLoader.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
526422
def loadnetcdf(filename, copy=True):
    
    filename = str(Path(filename).expanduser())

    if copy:
        dataarray = xr.open_dataarray(filename).copy()
    else:
        dataarray = xr.open_dataarray(filename, chunks={})

    if dataarray.name is None:
        dataarray.name = filename.rstrip('.nc')

    for key, val in dataarray.coords.items():
        if val.dtype.kind == 'S':
            dataarray[key] = val.astype('U')
        elif val.dtype == np.int32:
            dataarray[key] = val.astype('i8')

    return dataarray
681043
public static LifecycleChaincodePackage fromFile(File policyFile) throws IOException, InvalidArgumentException {
        if (null == policyFile) {
            throw new InvalidArgumentException("The parameter policyFile may not be null.");
        }
        try (InputStream is = new FileInputStream(policyFile)) {
            byte[] packageBytes = IOUtils.toByteArray(is);
            return fromBytes(packageBytes);
        }
    }
1374442
public static void addEvidences(ProbabilisticNetwork bn,
            Map<String, String> evidences) throws ShanksException {
        for (Entry<String, String> evidence : evidences.entrySet()) {
            ShanksAgentBayesianReasoningCapability.addEvidence(bn,
                    evidence.getKey(), evidence.getValue());
        }
    }
843054
public static DistributionStats load(@NonNull File meanFile, @NonNull File stdFile) throws IOException {
        return new DistributionStats(Nd4j.readBinary(meanFile), Nd4j.readBinary(stdFile));
    }
837826
private Map<String,SemanticVector> loadBinary(File sspaceFile) 
        throws IOException {

        LOGGER.info("loading binary TSS from " + sspaceFile);

        DataInputStream dis = 
            new DataInputStream(new FileInputStream(sspaceFile));
        int words = dis.readInt();
        dimensions = dis.readInt();

        // initialize to the number of words, but keep the loading factor high
        // to reduce empty table space
        Map<String,SemanticVector> wordToSemantics = 
            new HashMap<String,SemanticVector>(words, 2f);

        for (int wordIndex = 0; wordIndex < words; ++wordIndex) {
            String word = dis.readUTF();
            int timeSteps = dis.readInt();
            SemanticVector vector = new SemanticVector(dimensions);
            wordToSemantics.put(word, vector);

            LOGGER.info("loading " + timeSteps + 
                " timesteps for word " + word); 

            // Load that time step's vector.  Note that we make the assumption
            // here that even though the T-Space is serialized in a dense
            // format, that the vector data is actually sparse, and so it will
            // be more efficient to store it as such.
            Map<Integer,Double> semantics = new IntegerMap<Double>();

            // read in each time step
            for (int tsIndex = 0; tsIndex < timeSteps; ++tsIndex) {
                long timeStep = dis.readLong();
                updateTimeRange(timeStep);
                // load that time step's vector
                for (int i = 0; i < dimensions; ++i) {
                    int index = dis.readInt();
                    double val = dis.readDouble();
                    semantics.put(Integer.valueOf(index), Double.valueOf(val));
                }
                // associate the time step with the semantics
                vector.setSemantics(timeStep, semantics);
            }
        }
        return wordToSemantics;
    }