Class NormalizerSerializer
- java.lang.Object
-
- org.nd4j.linalg.dataset.api.preprocessor.serializer.NormalizerSerializer
-
public class NormalizerSerializer extends Object
-
-
Constructor Summary
Constructors Constructor Description NormalizerSerializer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NormalizerSerializer
addStrategy(@NonNull NormalizerSerializerStrategy strategy)
Add a normalizer serializer strategystatic NormalizerSerializer
getDefault()
Get the default serializer configured with strategies for the built-in normalizer implementations<T extends Normalizer>
Trestore(@NonNull File file)
Restore a normalizer from the given file<T extends Normalizer>
Trestore(@NonNull InputStream stream)
Restore a normalizer from an input stream<T extends Normalizer>
Trestore(@NonNull String path)
Restore a normalizer from the given pathvoid
write(@NonNull Normalizer normalizer, @NonNull File file)
Serialize a normalizer to the given filevoid
write(@NonNull Normalizer normalizer, @NonNull OutputStream stream)
Serialize a normalizer to an output streamvoid
write(@NonNull Normalizer normalizer, @NonNull String path)
Serialize a normalizer to the given file path
-
-
-
Method Detail
-
write
public void write(@NonNull @NonNull Normalizer normalizer, @NonNull @NonNull File file) throws IOException
Serialize a normalizer to the given file- Parameters:
normalizer
- the normalizerfile
- the destination file- Throws:
IOException
-
write
public void write(@NonNull @NonNull Normalizer normalizer, @NonNull @NonNull String path) throws IOException
Serialize a normalizer to the given file path- Parameters:
normalizer
- the normalizerpath
- the destination file path- Throws:
IOException
-
write
public void write(@NonNull @NonNull Normalizer normalizer, @NonNull @NonNull OutputStream stream) throws IOException
Serialize a normalizer to an output stream- Parameters:
normalizer
- the normalizerstream
- the output stream to write to- Throws:
IOException
-
restore
public <T extends Normalizer> T restore(@NonNull @NonNull String path) throws Exception
Restore a normalizer from the given path- Parameters:
path
- path of the file containing a serialized normalizer- Returns:
- the restored normalizer
- Throws:
IOException
Exception
-
restore
public <T extends Normalizer> T restore(@NonNull @NonNull File file) throws Exception
Restore a normalizer from the given file- Parameters:
file
- the file containing a serialized normalizer- Returns:
- the restored normalizer
- Throws:
IOException
Exception
-
restore
public <T extends Normalizer> T restore(@NonNull @NonNull InputStream stream) throws Exception
Restore a normalizer from an input stream- Parameters:
stream
- a stream of serialized normalizer data- Returns:
- the restored normalizer
- Throws:
IOException
Exception
-
getDefault
public static NormalizerSerializer getDefault()
Get the default serializer configured with strategies for the built-in normalizer implementations- Returns:
- the default serializer
-
addStrategy
public NormalizerSerializer addStrategy(@NonNull @NonNull NormalizerSerializerStrategy strategy)
Add a normalizer serializer strategy- Parameters:
strategy
- the new strategy- Returns:
- self
-
-