:py:mod:`orcanet.lib.dataset_modifiers` ======================================= .. py:module:: orcanet.lib.dataset_modifiers Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: orcanet.lib.dataset_modifiers.as_array orcanet.lib.dataset_modifiers.as_recarray orcanet.lib.dataset_modifiers.as_recarray_dist orcanet.lib.dataset_modifiers.as_recarray_dist_split .. py:function:: as_array(info_blob) Save network output as ndarrays to h5. This is the default dataset modifier. Every output layer will get one dataset each for both the label and the prediction. E.g. if the model has an output layer called "energy", the datasets "label_energy" and "pred_energy" will be made. .. !! processed by numpydoc !! .. py:function:: as_recarray(info_blob) Save network output as recarray to h5. Intended for when network outputs are 2D, i.e. (batchsize, X). Output from network: Dict with arrays, shapes (batchsize, x_i). E.g. {"foo": ndarray, "bar": ndarray} dtypes that will get saved to h5: (foo_1, foo_2, ..., bar_1, bar_2, ... ) .. !! processed by numpydoc !! .. py:function:: as_recarray_dist(info_blob) Save network output as recarray to h5. Intended for when network outputs are distributions and thus 3D (for example when using OutputRegNormal as output layer block). I.e. (batchsize, 2, X), with [:, 0] being mu and [:, 1] being std. Example output from network: shape {"A": (bs, 2), "B": (bs, 2, 3)} [:, 0] is reco, [:, 1] is err dtypes that will get saved to h5: A_1, A_err_1, B_1, B_2, B_3, B_err_1, B_err_2, B_err_3 .. !! processed by numpydoc !! .. py:function:: as_recarray_dist_split(info_blob) Save network output as recarray to h5. Intended for networks that output recos and errs in seperate towers (for example when using OutputRegNormalSplit as output layer block). Example output from network: shape {"A": (bs, 1), "A_err": (bs, 2, 1), "B": (bs, 3), "B_err": (bs, 2, 3)} In "A_err": [:, 0] is mu, [:, 1] is sigma dtypes that will get saved to h5: A_1, A_err_1, B_1, B_1_err, B_2, B_err_2, ... .. !! processed by numpydoc !!