Skip to content

Commit 12e6bce

Browse files
author
Vincent Moens
committed
[Deprecation] Change the default MLP depth
ghstack-source-id: bd34b8e Pull Request resolved: #2746
1 parent 0ecfbe3 commit 12e6bce

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

torchrl/modules/models/models.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from __future__ import annotations
66

77
import dataclasses
8-
import warnings
98

109
from copy import deepcopy
1110
from numbers import Number
@@ -51,6 +50,7 @@ class MLP(nn.Sequential):
5150
argument (see below). If ``num_cells`` is an iterable and depth is
5251
indicated, both should match: ``len(num_cells)`` must be equal to
5352
``depth``.
53+
Defaults to ``0`` (no depth - the network contains a single linear layer).
5454
num_cells (int or sequence of int, optional): number of cells of every
5555
layer in between the input and output. If an integer is provided,
5656
every layer will have the same number of cells. If an iterable is provided,
@@ -181,17 +181,10 @@ def __init__(
181181
raise ValueError("out_features must be specified for MLP.")
182182

183183
if num_cells is None:
184-
warnings.warn(
185-
"The current behavior of MLP when not providing `num_cells` is that the number of cells is "
186-
"set to [default_num_cells] * depth, where `depth=3` by default and `default_num_cells=0`. "
187-
"From v0.7, this behavior will switch and `depth=0` will be used. "
188-
"To silence tis message, indicate what number of cells you desire.",
189-
category=DeprecationWarning,
190-
)
191184
default_num_cells = 32
192185
if depth is None:
193-
num_cells = [default_num_cells] * 3
194-
depth = 3
186+
num_cells = []
187+
depth = 0
195188
else:
196189
num_cells = [default_num_cells] * depth
197190

0 commit comments

Comments
 (0)