Exemplo n.º 1
0
        ToProto(string name, bool isTraining)
        {
            var brainParametersProto = new CommunicatorObjects.BrainParametersProto
            {
                VectorObservationSize        = vectorObservationSize,
                NumStackedVectorObservations = numStackedVectorObservations,
                VectorActionSize             = { vectorActionSize },
                VectorActionSpaceType        =
                    (CommunicatorObjects.SpaceTypeProto)vectorActionSpaceType,
                BrainName  = name,
                IsTraining = isTraining
            };

            brainParametersProto.VectorActionDescriptions.AddRange(vectorActionDescriptions);
            foreach (Resolution res in cameraResolutions)
            {
                brainParametersProto.CameraResolutions.Add(
                    new CommunicatorObjects.ResolutionProto
                {
                    Width     = res.width,
                    Height    = res.height,
                    GrayScale = res.blackAndWhite
                });
            }
            return(brainParametersProto);
        }
Exemplo n.º 2
0
 public BrainParameters(CommunicatorObjects.BrainParametersProto brainParametersProto)
 {
     vectorObservationSize        = brainParametersProto.VectorObservationSize;
     numStackedVectorObservations = brainParametersProto.NumStackedVectorObservations;
     vectorActionSize             = brainParametersProto.VectorActionSize.ToArray();
     vectorActionDescriptions     = brainParametersProto.VectorActionDescriptions.ToArray();
     vectorActionSpaceType        = (SpaceType)brainParametersProto.VectorActionSpaceType;
 }