@@ -596,11 +596,10 @@ module subroutine train(self, input_data, output_data, batch_size, &
596596 integer , intent (in ) :: epochs
597597 class(optimizer_base_type), intent (in ), optional :: optimizer
598598 class(loss_type), intent (in ), optional :: loss
599- class(optimizer_base_type), allocatable :: optimizer_
600599
601600 real :: pos
602601 integer :: dataset_size
603- integer :: batch_start, batch_end
602+ integer :: batch_start
604603 integer :: i, j, n
605604 integer :: istart, iend, indices(2 )
606605
@@ -630,11 +629,9 @@ module subroutine train(self, input_data, output_data, batch_size, &
630629 ! Pull a random mini-batch from the dataset
631630 call random_number (pos)
632631 batch_start = int (pos * (dataset_size - batch_size + 1 )) + 1
633- batch_end = batch_start + batch_size - 1
634632
635633 ! FIXME shuffle in a way that doesn't require co_broadcast
636634 call co_broadcast(batch_start, 1 )
637- call co_broadcast(batch_end, 1 )
638635
639636 ! Distribute the batch in nearly equal pieces to all images
640637 indices = tile_indices(batch_size)
@@ -658,7 +655,6 @@ module subroutine update(self, optimizer, batch_size)
658655 class(network), intent (in out ) :: self
659656 class(optimizer_base_type), intent (in ), optional :: optimizer
660657 integer , intent (in ), optional :: batch_size
661- class(optimizer_base_type), allocatable :: optimizer_
662658 integer :: batch_size_
663659 real , allocatable :: params(:)
664660 integer :: n
0 commit comments