dataframe-hasktorch 0.1.0.1 → 0.1.0.2
raw patch · 3 files changed
+9/−5 lines, 3 files
Files
- CHANGELOG.md +4/−0
- dataframe-hasktorch.cabal +4/−4
- src/DataFrame/Hasktorch.hs +1/−1
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for dataframe-hasktorch +## 0.1.0.2++* Add unbox constraint to `flattenFeatures`.+ ## 0.1.0.1 * Export `toIntTensor` function that converts a dataframe to an Int tensor.
dataframe-hasktorch.cabal view
@@ -1,19 +1,19 @@ cabal-version: 3.0 name: dataframe-hasktorch-version: 0.1.0.1+version: 0.1.0.2 synopsis: Converts between dataframes and hasktorch tensors description: This package provides seamless conversion between dataframes and hasktorch tensors, bridging the gap between data manipulation and machine learning workflows.- .+ Key features:- .+ * Convert dataframes to floating-point or integer tensors for ML training * Automatic handling of multi-column and single-column dataframes * Smart dimensional handling (1D tensors for single columns, 2D for multiple) * Type-safe conversions with comprehensive error handling- .+ Typical workflow: load and transform data using dataframes, then convert to tensors for training neural networks with hasktorch.
src/DataFrame/Hasktorch.hs view
@@ -105,7 +105,7 @@ in reshape dims' (asTensor (flattenFeatures m)) -flattenFeatures :: V.Vector (VU.Vector a) -> VU.Vector a+flattenFeatures :: (VU.Unbox a) => V.Vector (VU.Vector a) -> VU.Vector a flattenFeatures rows = let total = V.foldl' (\s v -> s + VU.length v) 0 rows