本文整理汇总了Python中dragnn.python.bulk_component.BulkFeatureIdExtractorComponentBuilder方法的典型用法代码示例。如果您正苦于以下问题:Python bulk_component.BulkFeatureIdExtractorComponentBuilder方法的具体用法?Python bulk_component.BulkFeatureIdExtractorComponentBuilder怎么用?Python bulk_component.BulkFeatureIdExtractorComponentBuilder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dragnn.python.bulk_component
的用法示例。
在下文中一共展示了bulk_component.BulkFeatureIdExtractorComponentBuilder方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testBulkFeatureIdExtractorOkWithOneFixedFeature
# 需要导入模块: from dragnn.python import bulk_component [as 别名]
# 或者: from dragnn.python.bulk_component import BulkFeatureIdExtractorComponentBuilder [as 别名]
def testBulkFeatureIdExtractorOkWithOneFixedFeature(self):
component_spec = spec_pb2.ComponentSpec()
text_format.Parse("""
name: "test"
network_unit {
registered_name: "IdentityNetwork"
}
fixed_feature {
name: "fixed" embedding_dim: -1 size: 1
}
""", component_spec)
with tf.Graph().as_default():
comp = bulk_component.BulkFeatureIdExtractorComponentBuilder(
self.master, component_spec)
# Should not raise errors.
self.network_states[component_spec.name] = component.NetworkState()
comp.build_greedy_training(self.master_state, self.network_states)
self.network_states[component_spec.name] = component.NetworkState()
comp.build_greedy_inference(self.master_state, self.network_states)
示例2: testBulkFeatureIdExtractorFailsOnLinkedFeature
# 需要导入模块: from dragnn.python import bulk_component [as 别名]
# 或者: from dragnn.python.bulk_component import BulkFeatureIdExtractorComponentBuilder [as 别名]
def testBulkFeatureIdExtractorFailsOnLinkedFeature(self):
component_spec = spec_pb2.ComponentSpec()
text_format.Parse("""
name: "test"
network_unit {
registered_name: "IdentityNetwork"
}
fixed_feature {
name: "fixed" embedding_dim: -1 size: 1
}
linked_feature {
name: "linked" embedding_dim: -1 size: 1
source_translator: "identity"
source_component: "mock"
}
""", component_spec)
with tf.Graph().as_default():
with self.assertRaises(ValueError):
unused_comp = bulk_component.BulkFeatureIdExtractorComponentBuilder(
self.master, component_spec)
示例3: testBulkFeatureIdExtractorOkWithOneFixedFeature
# 需要导入模块: from dragnn.python import bulk_component [as 别名]
# 或者: from dragnn.python.bulk_component import BulkFeatureIdExtractorComponentBuilder [as 别名]
def testBulkFeatureIdExtractorOkWithOneFixedFeature(self):
component_spec = spec_pb2.ComponentSpec()
text_format.Parse("""
name: "test"
network_unit {
registered_name: "IdentityNetwork"
}
fixed_feature {
name: "fixed" embedding_dim: -1 size: 1
}
""", component_spec)
comp = bulk_component.BulkFeatureIdExtractorComponentBuilder(
self.master, component_spec)
# Should not raise errors.
self.network_states[component_spec.name] = component.NetworkState()
comp.build_greedy_training(self.master_state, self.network_states)
self.network_states[component_spec.name] = component.NetworkState()
comp.build_greedy_inference(self.master_state, self.network_states)
示例4: testBulkFeatureIdExtractorFailsOnLinkedFeature
# 需要导入模块: from dragnn.python import bulk_component [as 别名]
# 或者: from dragnn.python.bulk_component import BulkFeatureIdExtractorComponentBuilder [as 别名]
def testBulkFeatureIdExtractorFailsOnLinkedFeature(self):
component_spec = spec_pb2.ComponentSpec()
text_format.Parse("""
name: "test"
network_unit {
registered_name: "IdentityNetwork"
}
fixed_feature {
name: "fixed" embedding_dim: -1 size: 1
}
linked_feature {
name: "linked" embedding_dim: -1 size: 1
source_translator: "identity"
source_component: "mock"
}
""", component_spec)
with self.assertRaises(ValueError):
unused_comp = bulk_component.BulkFeatureIdExtractorComponentBuilder(
self.master, component_spec)
示例5: testBulkFeatureIdExtractorOkWithMultipleFixedFeatures
# 需要导入模块: from dragnn.python import bulk_component [as 别名]
# 或者: from dragnn.python.bulk_component import BulkFeatureIdExtractorComponentBuilder [as 别名]
def testBulkFeatureIdExtractorOkWithMultipleFixedFeatures(self):
component_spec = spec_pb2.ComponentSpec()
text_format.Parse("""
name: "test"
network_unit {
registered_name: "IdentityNetwork"
}
fixed_feature {
name: "fixed1" embedding_dim: -1 size: 1
}
fixed_feature {
name: "fixed2" embedding_dim: -1 size: 1
}
fixed_feature {
name: "fixed3" embedding_dim: -1 size: 1
}
""", component_spec)
comp = bulk_component.BulkFeatureIdExtractorComponentBuilder(
self.master, component_spec)
# Should not raise errors.
self.network_states[component_spec.name] = component.NetworkState()
comp.build_greedy_training(self.master_state, self.network_states)
self.network_states[component_spec.name] = component.NetworkState()
comp.build_greedy_inference(self.master_state, self.network_states)
示例6: testBulkFeatureIdExtractorOkWithMultipleFixedFeatures
# 需要导入模块: from dragnn.python import bulk_component [as 别名]
# 或者: from dragnn.python.bulk_component import BulkFeatureIdExtractorComponentBuilder [as 别名]
def testBulkFeatureIdExtractorOkWithMultipleFixedFeatures(self):
component_spec = spec_pb2.ComponentSpec()
text_format.Parse("""
name: "test"
network_unit {
registered_name: "IdentityNetwork"
}
fixed_feature {
name: "fixed1" embedding_dim: -1 size: 1
}
fixed_feature {
name: "fixed2" embedding_dim: -1 size: 1
}
fixed_feature {
name: "fixed3" embedding_dim: -1 size: 1
}
""", component_spec)
with tf.Graph().as_default():
comp = bulk_component.BulkFeatureIdExtractorComponentBuilder(
self.master, component_spec)
# Should not raise errors.
self.network_states[component_spec.name] = component.NetworkState()
comp.build_greedy_training(self.master_state, self.network_states)
self.network_states[component_spec.name] = component.NetworkState()
comp.build_greedy_inference(self.master_state, self.network_states)
示例7: testBulkFeatureIdExtractorFailsOnEmbeddedFixedFeature
# 需要导入模块: from dragnn.python import bulk_component [as 别名]
# 或者: from dragnn.python.bulk_component import BulkFeatureIdExtractorComponentBuilder [as 别名]
def testBulkFeatureIdExtractorFailsOnEmbeddedFixedFeature(self):
component_spec = spec_pb2.ComponentSpec()
text_format.Parse("""
name: "test"
network_unit {
registered_name: "IdentityNetwork"
}
fixed_feature {
name: "fixed" embedding_dim: 2 size: 1
}
""", component_spec)
with tf.Graph().as_default():
with self.assertRaises(ValueError):
unused_comp = bulk_component.BulkFeatureIdExtractorComponentBuilder(
self.master, component_spec)