Skip to content

Commit

Permalink
MAJOR: Version 0.2: New API and config file (now yaml)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRieutord committed Sep 18, 2023
1 parent 3eeff71 commit 70ec955
Show file tree
Hide file tree
Showing 12 changed files with 396 additions and 304 deletions.
1 change: 0 additions & 1 deletion README

This file was deleted.

44 changes: 44 additions & 0 deletions configs/new_config_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
xp_name: new_config_[id]
seed: 666
cuda: true
paths:
data_dir: <your data dir>
experiments_dir: <your experiments dir>
dimensions:
n_channels_hiddenlay: 32
n_channels_embedding: 50
n_px_embedding: 600
dataloader:
type: LandcoverToLandcoverDataLoader
params:
datasets: ["ecosg.hdf5", "mos.hdf5"]
num_workers: 0
pos_enc: true
training:
batch_size: 16
n_epochs: 3
tensorboard: false
validate_every: 1
print_inc: 10
agent:
type: MultiLULCAgent
params: {}
model:
type: universal_embedding
name: UnivEmb
use_pos: false
params:
memory_monger: false
up_mode: bilinear
#num_groups: 4
decoder_depth: 1
mode: light
pooling_factors: [3,3,3,3,3]
mul: true
softpos: true
decoder_atrou: true
optimizer:
type: Adam
params:
lr: 0.0001

8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ def main():
arg_parser = argparse.ArgumentParser(description="")
arg_parser.add_argument(
'config',
metavar='config_json_file',
metavar='config_yaml_file',
default='None',
help='The Configuration file in json format')
help='The configuration file in YAML format')
args = arg_parser.parse_args()

# parse the config json file
config = utilconf.process_config(args.config)

# Create the Agent and pass all the configuration to it then run it..
agent_class = getattr(multiLULC, config.agent)
agent = agent_class(config)
agent_class = getattr(multiLULC, config.agent.type)
agent = agent_class(config, **config.agent.params)
agent.run()
agent.finalize()

Expand Down
Loading

0 comments on commit 70ec955

Please sign in to comment.