mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-25 10:32:59 +00:00
properly handle water dimensions; add log files to .gitignore
TODO: add heightmap
This commit is contained in:
parent
5846828f9e
commit
654eefd9ca
4 changed files with 13 additions and 4 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,6 @@
|
|||
*.err
|
||||
*.out
|
||||
*.log
|
||||
output
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/python,node,git,visualstudiocode
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=python,node,git,visualstudiocode
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#SBATCH -N 1
|
||||
#SBATCH -n 4
|
||||
#SBATCH --gres=gpu:1
|
||||
#SBATCH -o %j.%N.%a.out
|
||||
#SBATCH -e %j.%N.%a.err
|
||||
#SBATCH -o %j.%N.%a.out.log
|
||||
#SBATCH -e %j.%N.%a.err.log
|
||||
#SBATCH -p gpu05
|
||||
#SBATCH --time=5-00:00:00
|
||||
#SBATCH --exclusive
|
||||
|
|
|
@ -9,8 +9,11 @@ from .components.LossContrastive import LossContrastive
|
|||
def model_rainfallwater_contrastive(shape_rainfall, shape_water, feature_dim=200):
|
||||
logger.info(shape_rainfall)
|
||||
logger.info(shape_water)
|
||||
rainfall_width, rainfall_height, rainfall_channels = shape_rainfall
|
||||
water_width, water_height, water_channels = shape_water
|
||||
|
||||
# Shapes come from what rainfallwrangler sees them as, but we add an extra dimension when reading the .tfrecord file
|
||||
rainfall_width, rainfall_height, rainfall_channels = shape_rainfall # shape = [width, height, channels]
|
||||
water_width, water_height = shape_water # shape = [width, height]
|
||||
water_channels = 1 # added in dataset → make_dataset → parse_item
|
||||
|
||||
input_rainfall = tf.keras.layers.Input(
|
||||
shape=shape_rainfall
|
||||
|
|
|
@ -20,6 +20,9 @@ def parse_item(item):
|
|||
rainfall = tf.io.parse_tensor(parsed["rainfallradar"], out_type=tf.float32)
|
||||
water = tf.io.parse_tensor(parsed["waterdepth"], out_type=tf.float32)
|
||||
|
||||
# [width, height] → [width, height, channels]
|
||||
water = tf.expand_dims(water, axis=-1)
|
||||
|
||||
# TODO: The shape of the resulting tensor can't be statically determined, so we need to reshape here
|
||||
|
||||
# TODO: Any other additional parsing here, since multiple .map() calls are not optimal
|
||||
|
|
Loading…
Reference in a new issue