当前位置: 首页>>代码示例>>Python>>正文


Python ParamOverrides.param_keywords方法代码示例

本文整理汇总了Python中param.parameterized.ParamOverrides.param_keywords方法的典型用法代码示例。如果您正苦于以下问题:Python ParamOverrides.param_keywords方法的具体用法?Python ParamOverrides.param_keywords怎么用?Python ParamOverrides.param_keywords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在param.parameterized.ParamOverrides的用法示例。


在下文中一共展示了ParamOverrides.param_keywords方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from param.parameterized import ParamOverrides [as 别名]
# 或者: from param.parameterized.ParamOverrides import param_keywords [as 别名]
    def __init__(self,inherent_features={},**params):

        """
        If a dataset already and inherently includes certain features, a dictionary
        with feature-name:code-to-access-the-feature pairs should be supplied
        specifying how to select (e.g. from a set of images) the appropriate
        feature value.

        Any extra parameter values supplied here will be passed down to the
        feature_coordinators requested in features_to_vary.
        """
        p=ParamOverrides(self,params,allow_extra_keywords=True)

        super(PatternCoordinator, self).__init__(**p.param_keywords())

        self._feature_params = p.extra_keywords()

        self._inherent_features = inherent_features

        # And also, this key must be in feature_coordinators because _inherent_features
        # can have additional features such as i to support multiple images

        # TFALERT: Once spatial frequency (sf) is added, this will
        # cause warnings, because all image datasets will have a
        # spatial frequency inherent feature, but mostly we just
        # ignore that by having only a single size of DoG, which
        # discards all but a narrow range of sf.  So the dataset will
        # have sf inherently, but that won't be an error or even
        # worthy of a warning.
        if(len((set(self._inherent_features.keys()) - set(self.features_to_vary)) & set(self.feature_coordinators.keys()))):
            self.warning('Inherent feature present which is not requested in features')

        self._feature_coordinators_to_apply = []
        for feature, feature_coordinator in self.feature_coordinators.iteritems():
            if feature in self.features_to_vary and feature not in self._inherent_features:
                # if it is a list, append each list item individually
                if isinstance(feature_coordinator,list):
                    for individual_feature_coordinator in feature_coordinator:
                        self._feature_coordinators_to_apply.append(individual_feature_coordinator)
                else:
                    self._feature_coordinators_to_apply.append(feature_coordinator)
开发者ID:JoelChavas,项目名称:imagen,代码行数:43,代码来源:patterncoordinator.py

示例2: __init__

# 需要导入模块: from param.parameterized import ParamOverrides [as 别名]
# 或者: from param.parameterized.ParamOverrides import param_keywords [as 别名]
    def __init__(self,inherent_features=[],**params):

        """
        If a dataset already and inherently includes certain features,
        a list with the inherent feature names should be supplied.

        Any extra parameter values supplied here will be passed down
        to the feature_coordinators requested in features_to_vary.
        """
        p=ParamOverrides(self,params,allow_extra_keywords=True)

        super(PatternCoordinator, self).__init__(**p.param_keywords())

        self._feature_params = p.extra_keywords()

        self._inherent_features = inherent_features

        # TFALERT: Once spatial frequency (sf) is added, this will
        # cause warnings, because all image datasets will have a
        # spatial frequency inherent feature, but mostly we just
        # ignore that by having only a single size of DoG, which
        # discards all but a narrow range of sf.  So the dataset will
        # have sf inherently, but that won't be an error or even
        # worthy of a warning.
        if(len(set(self._inherent_features) - set(self.features_to_vary))):
            self.warning('Inherent feature present which is not requested in features')

        self._feature_coordinators_to_apply = []
        for feature, feature_coordinator in self.feature_coordinators.items():
            if feature in self.features_to_vary and feature not in self._inherent_features:
                # if it is a list, append each list item individually
                if isinstance(feature_coordinator,list):
                    for individual_feature_coordinator in feature_coordinator:
                        self._feature_coordinators_to_apply.append(individual_feature_coordinator)
                else:
                    self._feature_coordinators_to_apply.append(feature_coordinator)
开发者ID:ioam,项目名称:imagen,代码行数:38,代码来源:patterncoordinator.py


注:本文中的param.parameterized.ParamOverrides.param_keywords方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。