# Path: nn_utils/activations.py
# def softplus_1m(x):
#     return tf.math.softplus(x - 1)


from typing import Callable, Dict, List, Optional, Tuple
from nn_utils.activations import softplus_1m
import numpy as np
import tensorflow as tf
import nn_utils.math_utils as math_utils
            x[..., None, :] * self.scales[:, None],
            tf.concat([x_shape[:-1], self.num_frequencies * x_shape[-1:]], 0),
        )

        four_feat = tf.math.sin(tf.concat([xb, xb + 0.5 * np.pi], axis=-1))

        ret = []
        if self.include_input:
            ret += [x]

        return tf.concat(ret + [four_feat], axis=-1)

    def get_output_dimensionality(self):
        return self.out_dims


class AnnealedFourierEmbedding(tf.keras.layers.Layer):
    def __init__(
        self, num_frequencies, include_input: bool = True, input_dim: int = 3, **kwargs
    ):
        super(AnnealedFourierEmbedding, self).__init__(trainable=False, **kwargs)

        self.input_dims = input_dim
        self.base_embedder = FourierEmbedding(
            num_frequencies, include_input=False, input_dim=input_dim
        )
        self.num_frequencies = num_frequencies
        self.include_input = include_input

    # @tf.function

# Path: nn_utils/activations.py
# def softplus_1m(x):
#     return tf.math.softplus(x - 1)


# Path: nn_utils/nerf_layers.py
from typing import Callable, Dict, List, Optional, Tuple
from nn_utils.activations import softplus_1m
import numpy as np
import tensorflow as tf
import nn_utils.math_utils as math_utils

            x[..., None, :] * self.scales[:, None],
            tf.concat([x_shape[:-1], self.num_frequencies * x_shape[-1:]], 0),
        )

        four_feat = tf.math.sin(tf.concat([xb, xb + 0.5 * np.pi], axis=-1))

        ret = []
        if self.include_input:
            ret += [x]

        return tf.concat(ret + [four_feat], axis=-1)

    def get_output_dimensionality(self):
        return self.out_dims


class AnnealedFourierEmbedding(tf.keras.layers.Layer):
    def __init__(
        self, num_frequencies, include_input: bool = True, input_dim: int = 3, **kwargs
    ):
        super(AnnealedFourierEmbedding, self).__init__(trainable=False, **kwargs)

        self.input_dims = input_dim
        self.base_embedder = FourierEmbedding(
            num_frequencies, include_input=False, input_dim=input_dim
        )
        self.num_frequencies = num_frequencies
        self.include_input = include_input

    # @tf.function

    def call(self, x, alpha):