make ConfigSchema

setup_config_schema(
  pbgref,
  entities,
  relations,
  entity_path,
  edge_paths,
  checkpoint_path,
  dimension = 400L,
  init_scale = 0.001,
  max_norm = NULL,
  global_emb = FALSE,
  comparator = "dot",
  bias = FALSE,
  loss_fn = "softmax",
  margin = 0.1,
  regularization_coef = 0.001,
  regularizer = "N3",
  init_path = NULL,
  checkpoint_preservation_interval = NULL,
  num_epochs = 50L,
  num_edge_chunks = NULL,
  max_edges_per_chunk = 1000000000L,
  bucket_order = pbgref$config$BucketOrder$INSIDE_OUT,
  workers = NULL,
  batch_size = 1000L,
  num_batch_negs = 50L,
  num_uniform_negs = 1000L,
  disable_lhs_negs = FALSE,
  disable_rhs_negs = FALSE,
  lr = 0.1,
  relation_lr = NULL,
  eval_fraction = 0,
  eval_num_batch_negs = 1000L,
  eval_num_uniform_negs = 1000L,
  background_io = FALSE,
  verbose = 0L,
  hogwild_delay = 2,
  dynamic_relations = TRUE,
  num_machines = 1L,
  num_partition_servers = -1L,
  distributed_init_method = NULL,
  distributed_tree_init_order = TRUE,
  num_gpus = 0L,
  num_groups_for_partition_server = 16L,
  num_groups_per_sharded_partition_server = 1L,
  partition_shard_size = 250L,
  half_precision = FALSE
)

Arguments

pbgref

instance of torchbiggraph module

entities

EntitySchema instance

relations

list of RelationSchema instances

Examples

pbgref = reticulate::import("torchbiggraph")
ent = make_entity_schema(pbgref=pbgref)
entities=reticulate::dict(all=ent)
rs = BiocPBG::make_rel_schema(pbgref=pbgref)
cs = setup_config_schema( pbgref = pbgref, entities = entities,
   relations = list(rs), entity_path = tempdir(), edge_paths = c("tr", "va", "te"),
   checkpoint_path = "cp" )
cs
#> ConfigSchema(entities={'all': EntitySchema(num_partitions=1, featurized=False, dimension=None)}, relations=[RelationSchema(name='all_edges', lhs='all', rhs='all', weight=1.0, operator='complex_diagonal', all_negs=False)], dimension=400, init_scale=0.001, max_norm=None, global_emb=False, comparator='dot', bias=False, loss_fn='softmax', margin=0.1, regularization_coef=0.001, regularizer='N3', entity_path='/home/vincent/TEMP/Rtmpf7vh4D', edge_paths=['tr', 'va', 'te'], checkpoint_path='cp', init_path=None, checkpoint_preservation_interval=None, num_epochs=50, num_edge_chunks=None, max_edges_per_chunk=1000000000, bucket_order=<BucketOrder.INSIDE_OUT: 'inside_out'>, workers=None, batch_size=1000, num_batch_negs=50, num_uniform_negs=1000, disable_lhs_negs=False, disable_rhs_negs=False, lr=0.1, relation_lr=None, eval_fraction=0.0, eval_num_batch_negs=1000, eval_num_uniform_negs=1000, background_io=False, verbose=0, hogwild_delay=2.0, dynamic_relations=True, num_machines=1, num_partition_servers=-1, distributed_init_method=None, distributed_tree_init_order=True, num_gpus=0, num_groups_for_partition_server=16, num_groups_per_sharded_partition_server=1, partition_shard_size=250, half_precision=False)