當前位置: 首頁>>代碼示例>>Python>>正文


Python cfg.RNG_SEED屬性代碼示例

本文整理匯總了Python中fast_rcnn.config.cfg.RNG_SEED屬性的典型用法代碼示例。如果您正苦於以下問題:Python cfg.RNG_SEED屬性的具體用法?Python cfg.RNG_SEED怎麽用?Python cfg.RNG_SEED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在fast_rcnn.config.cfg的用法示例。


在下文中一共展示了cfg.RNG_SEED屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from fast_rcnn.config import cfg [as 別名]
# 或者: from fast_rcnn.config.cfg import RNG_SEED [as 別名]
def __init__(self, cls, dim, feature_scale=1.0,
                 C=0.001, B=10.0, pos_weight=2.0):
        self.pos = np.zeros((0, dim), dtype=np.float32)
        self.neg = np.zeros((0, dim), dtype=np.float32)
        self.B = B
        self.C = C
        self.cls = cls
        self.pos_weight = pos_weight
        self.dim = dim
        self.feature_scale = feature_scale
        self.svm = svm.LinearSVC(C=C, class_weight={1: 2, -1: 1},
                                 intercept_scaling=B, verbose=1,
                                 penalty='l2', loss='l1',
                                 random_state=cfg.RNG_SEED, dual=True)
        self.pos_cur = 0
        self.num_neg_added = 0
        self.retrain_limit = 2000
        self.evict_thresh = -1.1
        self.loss_history = [] 
開發者ID:playerkk,項目名稱:face-py-faster-rcnn,代碼行數:21,代碼來源:train_svms.py

示例2: __init__

# 需要導入模塊: from fast_rcnn.config import cfg [as 別名]
# 或者: from fast_rcnn.config.cfg import RNG_SEED [as 別名]
def __init__(self, queue, roidb, num_classes):
        super(BlobFetcher, self).__init__()
        self._queue = queue
        self._roidb = roidb
        self._num_classes = num_classes
        self._perm = None
        self._cur = 0
        self._shuffle_roidb_inds()
        # fix the random seed for reproducibility
        np.random.seed(cfg.RNG_SEED) 
開發者ID:ppengtang,項目名稱:dpl,代碼行數:12,代碼來源:layer.py

示例3: _init_caffe

# 需要導入模塊: from fast_rcnn.config import cfg [as 別名]
# 或者: from fast_rcnn.config.cfg import RNG_SEED [as 別名]
def _init_caffe(cfg):
    """Initialize pycaffe in a training process.
    """

    import caffe
    # fix the random seeds (numpy and caffe) for reproducibility
    np.random.seed(cfg.RNG_SEED)
    caffe.set_random_seed(cfg.RNG_SEED)
    # set up caffe
    caffe.set_mode_gpu()
    caffe.set_device(cfg.GPU_ID) 
開發者ID:playerkk,項目名稱:face-py-faster-rcnn,代碼行數:13,代碼來源:train_faster_rcnn_alt_opt.py

示例4: train_net

# 需要導入模塊: from fast_rcnn.config import cfg [as 別名]
# 或者: from fast_rcnn.config.cfg import RNG_SEED [as 別名]
def train_net(network_name, imdb, roidb, output_dir, tf_log, pretrained_model=None, max_iters=200000):
    config = tf.ConfigProto()
    config.allow_soft_placement=True
    # config.gpu_options.allow_growth=True
    with tf.Session(config=config) as sess:
        tf.set_random_seed(cfg.RNG_SEED)
        trainer = Trainer(sess, network_name, imdb, roidb, output_dir, tf_log, pretrained_model=pretrained_model)
        trainer.train_model(sess, max_iters) 
開發者ID:danfeiX,項目名稱:scene-graph-TF-release,代碼行數:10,代碼來源:train.py

示例5: __init__

# 需要導入模塊: from fast_rcnn.config import cfg [as 別名]
# 或者: from fast_rcnn.config.cfg import RNG_SEED [as 別名]
def __init__(self, queue, roidb, num_classes, gpu_id=0):
        super(BlobFetcher, self).__init__()
        self._queue = queue
        self._roidb = roidb
        self._num_classes = num_classes
        self._perm = None
        self._cur = 0
        self.gpu_id = gpu_id
        np.random.seed(gpu_id)
        self._shuffle_roidb_inds()
        # fix the random seed for reproducibility
        np.random.seed(cfg.RNG_SEED) 
開發者ID:po0ya,項目名稱:face-magnet,代碼行數:14,代碼來源:layer.py


注:本文中的fast_rcnn.config.cfg.RNG_SEED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。