本文整理汇总了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)