{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SageMaker.Types.HyperParameterTuningInstanceConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.TrainingInstanceType
data HyperParameterTuningInstanceConfig = HyperParameterTuningInstanceConfig'
{
HyperParameterTuningInstanceConfig -> TrainingInstanceType
instanceType :: TrainingInstanceType,
HyperParameterTuningInstanceConfig -> Natural
instanceCount :: Prelude.Natural,
HyperParameterTuningInstanceConfig -> Natural
volumeSizeInGB :: Prelude.Natural
}
deriving (HyperParameterTuningInstanceConfig
-> HyperParameterTuningInstanceConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HyperParameterTuningInstanceConfig
-> HyperParameterTuningInstanceConfig -> Bool
$c/= :: HyperParameterTuningInstanceConfig
-> HyperParameterTuningInstanceConfig -> Bool
== :: HyperParameterTuningInstanceConfig
-> HyperParameterTuningInstanceConfig -> Bool
$c== :: HyperParameterTuningInstanceConfig
-> HyperParameterTuningInstanceConfig -> Bool
Prelude.Eq, ReadPrec [HyperParameterTuningInstanceConfig]
ReadPrec HyperParameterTuningInstanceConfig
Int -> ReadS HyperParameterTuningInstanceConfig
ReadS [HyperParameterTuningInstanceConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HyperParameterTuningInstanceConfig]
$creadListPrec :: ReadPrec [HyperParameterTuningInstanceConfig]
readPrec :: ReadPrec HyperParameterTuningInstanceConfig
$creadPrec :: ReadPrec HyperParameterTuningInstanceConfig
readList :: ReadS [HyperParameterTuningInstanceConfig]
$creadList :: ReadS [HyperParameterTuningInstanceConfig]
readsPrec :: Int -> ReadS HyperParameterTuningInstanceConfig
$creadsPrec :: Int -> ReadS HyperParameterTuningInstanceConfig
Prelude.Read, Int -> HyperParameterTuningInstanceConfig -> ShowS
[HyperParameterTuningInstanceConfig] -> ShowS
HyperParameterTuningInstanceConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HyperParameterTuningInstanceConfig] -> ShowS
$cshowList :: [HyperParameterTuningInstanceConfig] -> ShowS
show :: HyperParameterTuningInstanceConfig -> String
$cshow :: HyperParameterTuningInstanceConfig -> String
showsPrec :: Int -> HyperParameterTuningInstanceConfig -> ShowS
$cshowsPrec :: Int -> HyperParameterTuningInstanceConfig -> ShowS
Prelude.Show, forall x.
Rep HyperParameterTuningInstanceConfig x
-> HyperParameterTuningInstanceConfig
forall x.
HyperParameterTuningInstanceConfig
-> Rep HyperParameterTuningInstanceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HyperParameterTuningInstanceConfig x
-> HyperParameterTuningInstanceConfig
$cfrom :: forall x.
HyperParameterTuningInstanceConfig
-> Rep HyperParameterTuningInstanceConfig x
Prelude.Generic)
newHyperParameterTuningInstanceConfig ::
TrainingInstanceType ->
Prelude.Natural ->
Prelude.Natural ->
HyperParameterTuningInstanceConfig
newHyperParameterTuningInstanceConfig :: TrainingInstanceType
-> Natural -> Natural -> HyperParameterTuningInstanceConfig
newHyperParameterTuningInstanceConfig
TrainingInstanceType
pInstanceType_
Natural
pInstanceCount_
Natural
pVolumeSizeInGB_ =
HyperParameterTuningInstanceConfig'
{ $sel:instanceType:HyperParameterTuningInstanceConfig' :: TrainingInstanceType
instanceType =
TrainingInstanceType
pInstanceType_,
$sel:instanceCount:HyperParameterTuningInstanceConfig' :: Natural
instanceCount = Natural
pInstanceCount_,
$sel:volumeSizeInGB:HyperParameterTuningInstanceConfig' :: Natural
volumeSizeInGB = Natural
pVolumeSizeInGB_
}
hyperParameterTuningInstanceConfig_instanceType :: Lens.Lens' HyperParameterTuningInstanceConfig TrainingInstanceType
hyperParameterTuningInstanceConfig_instanceType :: Lens' HyperParameterTuningInstanceConfig TrainingInstanceType
hyperParameterTuningInstanceConfig_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HyperParameterTuningInstanceConfig' {TrainingInstanceType
instanceType :: TrainingInstanceType
$sel:instanceType:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> TrainingInstanceType
instanceType} -> TrainingInstanceType
instanceType) (\s :: HyperParameterTuningInstanceConfig
s@HyperParameterTuningInstanceConfig' {} TrainingInstanceType
a -> HyperParameterTuningInstanceConfig
s {$sel:instanceType:HyperParameterTuningInstanceConfig' :: TrainingInstanceType
instanceType = TrainingInstanceType
a} :: HyperParameterTuningInstanceConfig)
hyperParameterTuningInstanceConfig_instanceCount :: Lens.Lens' HyperParameterTuningInstanceConfig Prelude.Natural
hyperParameterTuningInstanceConfig_instanceCount :: Lens' HyperParameterTuningInstanceConfig Natural
hyperParameterTuningInstanceConfig_instanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HyperParameterTuningInstanceConfig' {Natural
instanceCount :: Natural
$sel:instanceCount:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> Natural
instanceCount} -> Natural
instanceCount) (\s :: HyperParameterTuningInstanceConfig
s@HyperParameterTuningInstanceConfig' {} Natural
a -> HyperParameterTuningInstanceConfig
s {$sel:instanceCount:HyperParameterTuningInstanceConfig' :: Natural
instanceCount = Natural
a} :: HyperParameterTuningInstanceConfig)
hyperParameterTuningInstanceConfig_volumeSizeInGB :: Lens.Lens' HyperParameterTuningInstanceConfig Prelude.Natural
hyperParameterTuningInstanceConfig_volumeSizeInGB :: Lens' HyperParameterTuningInstanceConfig Natural
hyperParameterTuningInstanceConfig_volumeSizeInGB = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HyperParameterTuningInstanceConfig' {Natural
volumeSizeInGB :: Natural
$sel:volumeSizeInGB:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> Natural
volumeSizeInGB} -> Natural
volumeSizeInGB) (\s :: HyperParameterTuningInstanceConfig
s@HyperParameterTuningInstanceConfig' {} Natural
a -> HyperParameterTuningInstanceConfig
s {$sel:volumeSizeInGB:HyperParameterTuningInstanceConfig' :: Natural
volumeSizeInGB = Natural
a} :: HyperParameterTuningInstanceConfig)
instance
Data.FromJSON
HyperParameterTuningInstanceConfig
where
parseJSON :: Value -> Parser HyperParameterTuningInstanceConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"HyperParameterTuningInstanceConfig"
( \Object
x ->
TrainingInstanceType
-> Natural -> Natural -> HyperParameterTuningInstanceConfig
HyperParameterTuningInstanceConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"InstanceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"InstanceCount")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"VolumeSizeInGB")
)
instance
Prelude.Hashable
HyperParameterTuningInstanceConfig
where
hashWithSalt :: Int -> HyperParameterTuningInstanceConfig -> Int
hashWithSalt
Int
_salt
HyperParameterTuningInstanceConfig' {Natural
TrainingInstanceType
volumeSizeInGB :: Natural
instanceCount :: Natural
instanceType :: TrainingInstanceType
$sel:volumeSizeInGB:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> Natural
$sel:instanceCount:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> Natural
$sel:instanceType:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> TrainingInstanceType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TrainingInstanceType
instanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
instanceCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
volumeSizeInGB
instance
Prelude.NFData
HyperParameterTuningInstanceConfig
where
rnf :: HyperParameterTuningInstanceConfig -> ()
rnf HyperParameterTuningInstanceConfig' {Natural
TrainingInstanceType
volumeSizeInGB :: Natural
instanceCount :: Natural
instanceType :: TrainingInstanceType
$sel:volumeSizeInGB:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> Natural
$sel:instanceCount:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> Natural
$sel:instanceType:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> TrainingInstanceType
..} =
forall a. NFData a => a -> ()
Prelude.rnf TrainingInstanceType
instanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
instanceCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
volumeSizeInGB
instance
Data.ToJSON
HyperParameterTuningInstanceConfig
where
toJSON :: HyperParameterTuningInstanceConfig -> Value
toJSON HyperParameterTuningInstanceConfig' {Natural
TrainingInstanceType
volumeSizeInGB :: Natural
instanceCount :: Natural
instanceType :: TrainingInstanceType
$sel:volumeSizeInGB:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> Natural
$sel:instanceCount:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> Natural
$sel:instanceType:HyperParameterTuningInstanceConfig' :: HyperParameterTuningInstanceConfig -> TrainingInstanceType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"InstanceType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TrainingInstanceType
instanceType),
forall a. a -> Maybe a
Prelude.Just (Key
"InstanceCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
instanceCount),
forall a. a -> Maybe a
Prelude.Just
(Key
"VolumeSizeInGB" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
volumeSizeInGB)
]
)