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


Python loader.Loader方法代码示例

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


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

示例1: label

# 需要导入模块: import loader [as 别名]
# 或者: from loader import Loader [as 别名]
def label(args):
    """Label the provided report(s)."""

    loader = Loader(args.reports_path, args.extract_impression)

    extractor = Extractor(args.mention_phrases_dir,
                          args.unmention_phrases_dir,
                          verbose=args.verbose)
    classifier = Classifier(args.pre_negation_uncertainty_path,
                            args.negation_path,
                            args.post_negation_uncertainty_path,
                            verbose=args.verbose)
    aggregator = Aggregator(CATEGORIES,
                            verbose=args.verbose)

    # Load reports in place.
    loader.load()
    # Extract observation mentions in place.
    extractor.extract(loader.collection)
    # Classify mentions in place.
    classifier.classify(loader.collection)
    # Aggregate mentions to obtain one set of labels for each report.
    labels = aggregator.aggregate(loader.collection)

    write(loader.reports, labels, args.output_path, args.verbose) 
开发者ID:stanfordmlgroup,项目名称:chexpert-labeler,代码行数:27,代码来源:label.py

示例2: __init__

# 需要导入模块: import loader [as 别名]
# 或者: from loader import Loader [as 别名]
def __init__(self, sess, image_size=48, num_hid=512,
               model_type="dis+cls", batch_size=25, dataset="shape"):
    """Initialize the parameters for an Deep Visual Analogy network.

    Args:
      image_size: int, The size of width and height of input image
      model_type: string, The type of increment function ["add", "deep"]
      batch_size: int, The size of a batch [25]
      dataset: str, The name of dataset ["shape", ""]
    """
    self.sess = sess

    self.image_size = image_size
    self.model_type = model_type
    self.batch_size = batch_size
    self.dataset = dataset
    self.num_hid = num_hid
    #self.loader = Loader(self.dataset, self.batch_size)

    self.cards = [2, 4, 3, 6, 2, 2, 2]
    num_categorical = 0
    for card in self.cards:
        num_categorical = num_categorical + card
    self.cards[6] = 3;
    num_categorical = num_categorical + 1
    self.num_categorical = num_categorical

    self.id_idxes = range(0, self.num_categorical - 1)
    self.pose_idxes = range(self.num_categorical, self.num_hid)

    # parameters used to save a checkpoint
    self._attrs = ['max_iter', 'batch_size', 'alpha', 'learning_rate']

    self.build_model() 
开发者ID:carpedm20,项目名称:visual-analogy-tensorflow,代码行数:36,代码来源:sprite.py

示例3: __init__

# 需要导入模块: import loader [as 别名]
# 或者: from loader import Loader [as 别名]
def __init__(self, sess, image_size=48, model_type="deep",
               batch_size=25, dataset="shape"):
    """Initialize the parameters for an Deep Visual Analogy network.

    Args:
      image_size: int, The size of width and height of input image
      model_type: string, The type of increment function ["add", "deep"]
      batch_size: int, The size of a batch [25]
      dataset: str, The name of dataset ["shape", ""]
    """
    self.sess = sess

    self.image_size = image_size
    self.model_type = model_type
    self.batch_size = batch_size
    self.dataset = dataset
    self.loader = Loader(self.dataset, self.batch_size)

    self.sample_dir = "samples"
    if not os.path.exists(self.sample_dir):
      os.makedirs(self.sample_dir)

    # parameters used to save a checkpoint
    self._attrs = ['batch_size', 'model_type', 'image_size']
    self.options = ['rotate', 'scale', 'xpos', 'ypos']

    self.build_model() 
开发者ID:carpedm20,项目名称:visual-analogy-tensorflow,代码行数:29,代码来源:shape.py


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