Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
a5f3adbd
Commit
a5f3adbd
authored
Oct 29, 2022
by
Muhammad Rizqi Nur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow trailing comma in learning rate
parent
35c45df2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
learn_schedule.py
modules/textual_inversion/learn_schedule.py
+20
-13
No files found.
modules/textual_inversion/learn_schedule.py
View file @
a5f3adbd
...
@@ -11,23 +11,30 @@ class LearnScheduleIterator:
...
@@ -11,23 +11,30 @@ class LearnScheduleIterator:
self
.
rates
=
[]
self
.
rates
=
[]
self
.
it
=
0
self
.
it
=
0
self
.
maxit
=
0
self
.
maxit
=
0
for
i
,
pair
in
enumerate
(
pairs
):
try
:
tmp
=
pair
.
split
(
':'
)
for
i
,
pair
in
enumerate
(
pairs
):
if
len
(
tmp
)
==
2
:
if
not
pair
.
strip
():
step
=
int
(
tmp
[
1
])
continue
if
step
>
cur_step
:
tmp
=
pair
.
split
(
':'
)
self
.
rates
.
append
((
float
(
tmp
[
0
]),
min
(
step
,
max_steps
)))
if
len
(
tmp
)
==
2
:
self
.
maxit
+=
1
step
=
int
(
tmp
[
1
])
if
step
>
max_steps
:
if
step
>
cur_step
:
self
.
rates
.
append
((
float
(
tmp
[
0
]),
min
(
step
,
max_steps
)))
self
.
maxit
+=
1
if
step
>
max_steps
:
return
elif
step
==
-
1
:
self
.
rates
.
append
((
float
(
tmp
[
0
]),
max_steps
))
self
.
maxit
+=
1
return
return
el
if
step
==
-
1
:
el
se
:
self
.
rates
.
append
((
float
(
tmp
[
0
]),
max_steps
))
self
.
rates
.
append
((
float
(
tmp
[
0
]),
max_steps
))
self
.
maxit
+=
1
self
.
maxit
+=
1
return
return
else
:
assert
self
.
rates
self
.
rates
.
append
((
float
(
tmp
[
0
]),
max_steps
))
except
(
ValueError
,
AssertionError
):
self
.
maxit
+=
1
raise
Exception
(
"Invalid learning rate schedule"
)
return
def
__iter__
(
self
):
def
__iter__
(
self
):
return
self
return
self
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment