Releases: Labbeti/torchoutil
Releases · Labbeti/torchoutil
Version 0.5.0
[0.5.0] 2024-11-28
Major rework of torchoutil
project folders.
Added
- Tensor typing classes for instance checks like
Tensor2D
,FloatTensor1D
, etc. - Function
get_key_fn
to customize sorting using patterns. - Option
on_error
toload_yaml
to ignore yaml scanner and parser exceptions. - Function
ranks
to get the ranking values in a tensor. - Function
sort_with_patterns
to sort values using string-based patterns. - Function
pad_and_crop_dim
and classPadCropDim
to pad then crop a tensor along a specified dimension. - Function
reimport_modules
to re-import modules and functions in a notebook. - Function
checksum_module
to compare module weights. - Function
nelement
to get number of elements in Tensor-like object. - Function
flatten
to get flat of elements in Tensors, numpy array, builtins scalars and lists. - Added
DatasetSlicer
class in utils.
Modified
- Rename
is_pickle_root
tois_packed_root
(old name was kept for backward compatibility). - Split python functions into a separate directory called
pyoutil
.
Version 0.4.0
[0.4.0] 2024-05-27
Added
- Option
subdir_size
topack_dataset
. - Classes
CosDecayScheduler
andCosDecayRule
classes. - Function
sorted_dict
to collections. - Functions
ndim
andshape
to search information in tensor-like objects. - Function
item
to convert scalar-like objects to built-in scalar objects. - Mixin classes to improve module features.
Modified
- Rename
from_numpy
tonumpy_to_tensor
to avoid confusion withtorch.from_numpy
. - Rename
save_to_yaml
toto_yaml
andsave_to_csv
toto_csv
. - Rename
PickleDataset
toPackedDataset
. - Rename
pack_to_pickle
topack_dataset
. - Update
EModule
andESequential
classes with auto-config and auto-device detection.
Fixed
- Function
can_be_converted_to_tensor
now accepts numpy arrays and scalars. - Wildcard imports, and module imports. (e.g.
from torchoutil import nn
) can_be_stacked
now returns False with an empty sequence.
Version 0.3.1
[0.3.1] 2024-04-25
Added
- Method
count_parameters
toTModule
. - Option
padding_idx
toindices_to_onehot
function. - Functions
dict_list_to_list_dict
,flat_list
,unflat_dict_of_dict
to collections utils. - Class
PickleDataset
and functionpack_to_pickle
to utils. - Class
ResampleNearest
and functionresample_nearest
. - Class
TransformDrop
and functiontransform_drop
.
Fixed
- Remove invalid test file.
- Function
is_scalar
now returns True for numpy scalars when numpy package is installed.
Version 0.3.0
[0.3.0] 2024-04-17
Added
PositionalEncoding
layer for transformers networks.- Property
metadata
toHDFDataset
. - Function
create_params_groups_bias
for avoid apply weight decay to networks bias. - Functions
is_numpy_scalar
,is_torch_scalar
andunzip
. - Options
auto_open
,numpy_to_torch
andfile_kwargs
to customize loading inHDFDataset
.
Modified
- Update keyword arguments for mask, pad, labels functions and modules.
- Getting added column using
at
fromHDFDataset
whenreturn_added_columns
isFalse
. - Renamed
ModelCheckpointRegister
toRegistryHub
and add hash value check after download.
Fixed
can_be_converted_to_tensor
now returns True if input is a Tensor.
Version 0.2.2
[0.2.2] 2024-03-08
Fixed
ModelCheckpointRegister
now creates intermediate directories before download.MaskedMean
andMaskedSum
dim argument.
Version 0.2.1
[0.2.1] 2024-03-07
Added
ModelCheckpointRegister
class to make download and loading easier from checkpoint.
Modified
pack_to_hdf
now supports existing shape column.SizedDatasetLike
is now compatible withSequence
-like objects.
Version 0.2.0
[0.2.0] 2024-03-04
Added
- Optional hdf datasets with
HDFDataset
class andpack_to_hdf
function. - Multiclass functions to convert labels.
- Arg
diagonal
togenerate_square_subsequent_mask
. Abs
,Angle
,Real
andImag
modules.
Modified
- Use Literal for pad and crop functions typing.
- Minimal torch version is now 1.10.
Version 0.1.0
[0.1.0] 2024-01-29
Added
- 47 torch functions and 40 torch modules.