本文整理匯總了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 = []
示例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)
示例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)
示例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)
示例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)