{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SageMaker.Types.TrainingInputMode
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.TrainingInputMode
  ( TrainingInputMode
      ( ..,
        TrainingInputMode_FastFile,
        TrainingInputMode_File,
        TrainingInputMode_Pipe
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Prelude as Prelude

-- | The training input mode that the algorithm supports. For more
-- information about input modes, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html Algorithms>.
--
-- __Pipe mode__
--
-- If an algorithm supports @Pipe@ mode, Amazon SageMaker streams data
-- directly from Amazon S3 to the container.
--
-- __File mode__
--
-- If an algorithm supports @File@ mode, SageMaker downloads the training
-- data from S3 to the provisioned ML storage volume, and mounts the
-- directory to the Docker volume for the training container.
--
-- You must provision the ML storage volume with sufficient capacity to
-- accommodate the data downloaded from S3. In addition to the training
-- data, the ML storage volume also stores the output model. The algorithm
-- container uses the ML storage volume to also store intermediate
-- information, if any.
--
-- For distributed algorithms, training data is distributed uniformly. Your
-- training duration is predictable if the input data objects sizes are
-- approximately the same. SageMaker does not split the files any further
-- for model training. If the object sizes are skewed, training won\'t be
-- optimal as the data distribution is also skewed when one host in a
-- training cluster is overloaded, thus becoming a bottleneck in training.
--
-- __FastFile mode__
--
-- If an algorithm supports @FastFile@ mode, SageMaker streams data
-- directly from S3 to the container with no code changes, and provides
-- file system access to the data. Users can author their training script
-- to interact with these files as if they were stored on disk.
--
-- @FastFile@ mode works best when the data is read sequentially. Augmented
-- manifest files aren\'t supported. The startup time is lower when there
-- are fewer files in the S3 bucket provided.
newtype TrainingInputMode = TrainingInputMode'
  { TrainingInputMode -> Text
fromTrainingInputMode ::
      Core.Text
  }
  deriving stock
    ( Int -> TrainingInputMode -> ShowS
[TrainingInputMode] -> ShowS
TrainingInputMode -> String
(Int -> TrainingInputMode -> ShowS)
-> (TrainingInputMode -> String)
-> ([TrainingInputMode] -> ShowS)
-> Show TrainingInputMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrainingInputMode] -> ShowS
$cshowList :: [TrainingInputMode] -> ShowS
show :: TrainingInputMode -> String
$cshow :: TrainingInputMode -> String
showsPrec :: Int -> TrainingInputMode -> ShowS
$cshowsPrec :: Int -> TrainingInputMode -> ShowS
Prelude.Show,
      ReadPrec [TrainingInputMode]
ReadPrec TrainingInputMode
Int -> ReadS TrainingInputMode
ReadS [TrainingInputMode]
(Int -> ReadS TrainingInputMode)
-> ReadS [TrainingInputMode]
-> ReadPrec TrainingInputMode
-> ReadPrec [TrainingInputMode]
-> Read TrainingInputMode
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrainingInputMode]
$creadListPrec :: ReadPrec [TrainingInputMode]
readPrec :: ReadPrec TrainingInputMode
$creadPrec :: ReadPrec TrainingInputMode
readList :: ReadS [TrainingInputMode]
$creadList :: ReadS [TrainingInputMode]
readsPrec :: Int -> ReadS TrainingInputMode
$creadsPrec :: Int -> ReadS TrainingInputMode
Prelude.Read,
      TrainingInputMode -> TrainingInputMode -> Bool
(TrainingInputMode -> TrainingInputMode -> Bool)
-> (TrainingInputMode -> TrainingInputMode -> Bool)
-> Eq TrainingInputMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrainingInputMode -> TrainingInputMode -> Bool
$c/= :: TrainingInputMode -> TrainingInputMode -> Bool
== :: TrainingInputMode -> TrainingInputMode -> Bool
$c== :: TrainingInputMode -> TrainingInputMode -> Bool
Prelude.Eq,
      Eq TrainingInputMode
Eq TrainingInputMode
-> (TrainingInputMode -> TrainingInputMode -> Ordering)
-> (TrainingInputMode -> TrainingInputMode -> Bool)
-> (TrainingInputMode -> TrainingInputMode -> Bool)
-> (TrainingInputMode -> TrainingInputMode -> Bool)
-> (TrainingInputMode -> TrainingInputMode -> Bool)
-> (TrainingInputMode -> TrainingInputMode -> TrainingInputMode)
-> (TrainingInputMode -> TrainingInputMode -> TrainingInputMode)
-> Ord TrainingInputMode
TrainingInputMode -> TrainingInputMode -> Bool
TrainingInputMode -> TrainingInputMode -> Ordering
TrainingInputMode -> TrainingInputMode -> TrainingInputMode
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: TrainingInputMode -> TrainingInputMode -> TrainingInputMode
$cmin :: TrainingInputMode -> TrainingInputMode -> TrainingInputMode
max :: TrainingInputMode -> TrainingInputMode -> TrainingInputMode
$cmax :: TrainingInputMode -> TrainingInputMode -> TrainingInputMode
>= :: TrainingInputMode -> TrainingInputMode -> Bool
$c>= :: TrainingInputMode -> TrainingInputMode -> Bool
> :: TrainingInputMode -> TrainingInputMode -> Bool
$c> :: TrainingInputMode -> TrainingInputMode -> Bool
<= :: TrainingInputMode -> TrainingInputMode -> Bool
$c<= :: TrainingInputMode -> TrainingInputMode -> Bool
< :: TrainingInputMode -> TrainingInputMode -> Bool
$c< :: TrainingInputMode -> TrainingInputMode -> Bool
compare :: TrainingInputMode -> TrainingInputMode -> Ordering
$ccompare :: TrainingInputMode -> TrainingInputMode -> Ordering
$cp1Ord :: Eq TrainingInputMode
Prelude.Ord,
      (forall x. TrainingInputMode -> Rep TrainingInputMode x)
-> (forall x. Rep TrainingInputMode x -> TrainingInputMode)
-> Generic TrainingInputMode
forall x. Rep TrainingInputMode x -> TrainingInputMode
forall x. TrainingInputMode -> Rep TrainingInputMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrainingInputMode x -> TrainingInputMode
$cfrom :: forall x. TrainingInputMode -> Rep TrainingInputMode x
Prelude.Generic
    )
  deriving newtype
    ( Int -> TrainingInputMode -> Int
TrainingInputMode -> Int
(Int -> TrainingInputMode -> Int)
-> (TrainingInputMode -> Int) -> Hashable TrainingInputMode
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: TrainingInputMode -> Int
$chash :: TrainingInputMode -> Int
hashWithSalt :: Int -> TrainingInputMode -> Int
$chashWithSalt :: Int -> TrainingInputMode -> Int
Prelude.Hashable,
      TrainingInputMode -> ()
(TrainingInputMode -> ()) -> NFData TrainingInputMode
forall a. (a -> ()) -> NFData a
rnf :: TrainingInputMode -> ()
$crnf :: TrainingInputMode -> ()
Prelude.NFData,
      Text -> Either String TrainingInputMode
(Text -> Either String TrainingInputMode)
-> FromText TrainingInputMode
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String TrainingInputMode
$cfromText :: Text -> Either String TrainingInputMode
Core.FromText,
      TrainingInputMode -> Text
(TrainingInputMode -> Text) -> ToText TrainingInputMode
forall a. (a -> Text) -> ToText a
toText :: TrainingInputMode -> Text
$ctoText :: TrainingInputMode -> Text
Core.ToText,
      TrainingInputMode -> ByteString
(TrainingInputMode -> ByteString) -> ToByteString TrainingInputMode
forall a. (a -> ByteString) -> ToByteString a
toBS :: TrainingInputMode -> ByteString
$ctoBS :: TrainingInputMode -> ByteString
Core.ToByteString,
      TrainingInputMode -> ByteStringBuilder
(TrainingInputMode -> ByteStringBuilder) -> ToLog TrainingInputMode
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: TrainingInputMode -> ByteStringBuilder
$cbuild :: TrainingInputMode -> ByteStringBuilder
Core.ToLog,
      HeaderName -> TrainingInputMode -> [Header]
(HeaderName -> TrainingInputMode -> [Header])
-> ToHeader TrainingInputMode
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> TrainingInputMode -> [Header]
$ctoHeader :: HeaderName -> TrainingInputMode -> [Header]
Core.ToHeader,
      TrainingInputMode -> QueryString
(TrainingInputMode -> QueryString) -> ToQuery TrainingInputMode
forall a. (a -> QueryString) -> ToQuery a
toQuery :: TrainingInputMode -> QueryString
$ctoQuery :: TrainingInputMode -> QueryString
Core.ToQuery,
      Value -> Parser [TrainingInputMode]
Value -> Parser TrainingInputMode
(Value -> Parser TrainingInputMode)
-> (Value -> Parser [TrainingInputMode])
-> FromJSON TrainingInputMode
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [TrainingInputMode]
$cparseJSONList :: Value -> Parser [TrainingInputMode]
parseJSON :: Value -> Parser TrainingInputMode
$cparseJSON :: Value -> Parser TrainingInputMode
Core.FromJSON,
      FromJSONKeyFunction [TrainingInputMode]
FromJSONKeyFunction TrainingInputMode
FromJSONKeyFunction TrainingInputMode
-> FromJSONKeyFunction [TrainingInputMode]
-> FromJSONKey TrainingInputMode
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [TrainingInputMode]
$cfromJSONKeyList :: FromJSONKeyFunction [TrainingInputMode]
fromJSONKey :: FromJSONKeyFunction TrainingInputMode
$cfromJSONKey :: FromJSONKeyFunction TrainingInputMode
Core.FromJSONKey,
      [TrainingInputMode] -> Encoding
[TrainingInputMode] -> Value
TrainingInputMode -> Encoding
TrainingInputMode -> Value
(TrainingInputMode -> Value)
-> (TrainingInputMode -> Encoding)
-> ([TrainingInputMode] -> Value)
-> ([TrainingInputMode] -> Encoding)
-> ToJSON TrainingInputMode
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [TrainingInputMode] -> Encoding
$ctoEncodingList :: [TrainingInputMode] -> Encoding
toJSONList :: [TrainingInputMode] -> Value
$ctoJSONList :: [TrainingInputMode] -> Value
toEncoding :: TrainingInputMode -> Encoding
$ctoEncoding :: TrainingInputMode -> Encoding
toJSON :: TrainingInputMode -> Value
$ctoJSON :: TrainingInputMode -> Value
Core.ToJSON,
      ToJSONKeyFunction [TrainingInputMode]
ToJSONKeyFunction TrainingInputMode
ToJSONKeyFunction TrainingInputMode
-> ToJSONKeyFunction [TrainingInputMode]
-> ToJSONKey TrainingInputMode
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [TrainingInputMode]
$ctoJSONKeyList :: ToJSONKeyFunction [TrainingInputMode]
toJSONKey :: ToJSONKeyFunction TrainingInputMode
$ctoJSONKey :: ToJSONKeyFunction TrainingInputMode
Core.ToJSONKey,
      [Node] -> Either String TrainingInputMode
([Node] -> Either String TrainingInputMode)
-> FromXML TrainingInputMode
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String TrainingInputMode
$cparseXML :: [Node] -> Either String TrainingInputMode
Core.FromXML,
      TrainingInputMode -> XML
(TrainingInputMode -> XML) -> ToXML TrainingInputMode
forall a. (a -> XML) -> ToXML a
toXML :: TrainingInputMode -> XML
$ctoXML :: TrainingInputMode -> XML
Core.ToXML
    )

pattern TrainingInputMode_FastFile :: TrainingInputMode
pattern $bTrainingInputMode_FastFile :: TrainingInputMode
$mTrainingInputMode_FastFile :: forall r. TrainingInputMode -> (Void# -> r) -> (Void# -> r) -> r
TrainingInputMode_FastFile = TrainingInputMode' "FastFile"

pattern TrainingInputMode_File :: TrainingInputMode
pattern $bTrainingInputMode_File :: TrainingInputMode
$mTrainingInputMode_File :: forall r. TrainingInputMode -> (Void# -> r) -> (Void# -> r) -> r
TrainingInputMode_File = TrainingInputMode' "File"

pattern TrainingInputMode_Pipe :: TrainingInputMode
pattern $bTrainingInputMode_Pipe :: TrainingInputMode
$mTrainingInputMode_Pipe :: forall r. TrainingInputMode -> (Void# -> r) -> (Void# -> r) -> r
TrainingInputMode_Pipe = TrainingInputMode' "Pipe"

{-# COMPLETE
  TrainingInputMode_FastFile,
  TrainingInputMode_File,
  TrainingInputMode_Pipe,
  TrainingInputMode'
  #-}